AI Chat
PlayJS includes a built-in AI assistant that can help you understand code, explain output, debug errors, and answer programming questions — all without leaving the app.
Setup
Before using AI Chat, you need to configure a provider and API key:
- Go to Preferences → AI
- Select a provider from the dropdown: OpenAI, Anthropic, Google, DeepSeek, xAI, MiniMax, or Kimi
- Enter your API key for the selected provider
- Choose a model
Your API key is stored locally on your machine and is only sent to the provider’s API endpoint. See AI Preferences for more details on each provider.
Opening the Chat Panel
Click the AI Chat icon in the sidebar to open the chat panel. It appears as a resizable split panel alongside your editor, so you can chat with the AI while keeping your code visible.
Chatting with AI
Type your question in the input field and press Enter. The AI assistant can help with:
- Explaining code — Paste or reference code and ask the AI to explain what it does
- Debugging errors — Share an error message and get suggestions for how to fix it
- Learning concepts — Ask about JavaScript/TypeScript features, APIs, or programming patterns
- Writing code — Describe what you want to build and get code suggestions
Explaining Output with AI
Click the AI icon on the output panel to ask the AI to explain the current execution results. The AI analyzes both your source code and its output to provide a contextual explanation. This is especially useful when:
- You get an unexpected result and want to understand why
- You are experimenting with unfamiliar APIs or language features
- You want a quick summary of what a complex piece of code produces