Using the AI Chat
The AI chat is a coding assistant built directly into the CDBX editor. It can read and write your files, fix errors, and generate entire applications from a description.
Opening the Chat
The AI Chat panel is in the left sidebar. Click the Copilot tab to open it, or use the Generate with AI prompt on the dashboard to open it automatically.
Sending Messages
Type in the input box at the bottom and press Enter (or Shift+Enter for a new line). The AI reads your currently open file for context and can read any other file in your app on demand.
Attaching Files
Click the ”+” button next to the model picker and choose “Attach files” to attach a file to your message — images, text/code files (.py, .md, .json, and other common formats), and PDFs are all supported, on any message, not just your first one. You can also paste a screenshot (⌘V / Ctrl+V) or drag a file straight into the chat box. Images show a thumbnail with an ”✕” to remove them before sending; other files show as a chip with the filename.
A large image is scaled down before it’s sent. PDFs can be up to 2.5 MB here. For a bigger PDF, attach it on the Home prompt when you start an app, or paste the part you need.
PDFs get special handling depending on which model is selected: a Claude model reads the PDF directly, including diagrams, tables, and layout — not just the text. OpenAI, Moonshot, and Grok models instead read the extracted text only.
Attaching a file here adds it to the conversation as context for the AI — it doesn’t add it to your file tree. To add a file to your app itself, drag it into the file tree or use the tree’s upload button.
What the AI Can Do
Read and Write Files
The AI has access to tools that let it read and rewrite files in your app:
- Read — the AI reads a file to understand the current code before modifying it
- Write — the AI rewrites one or more files with new content
When files are being read or written you’ll see a progress indicator (e.g. “Writing App.jsx”) above the response. With auto-accept enabled (the default), changes are applied immediately. With auto-accept off, changes are queued for you to review.
Reviewing AI changes
Turn off Auto-accept AI edits (AI settings) if you’d rather check each change before it lands. When it’s off:
- A banner appears in the chat, just above the message box, listing every file waiting for review — for example “2 files awaiting review”.
- Accept all applies every queued change and refreshes the preview. Reject all discards them.
- You can also accept or reject one file at a time from the banner, or click a filename to open it in the editor and read the side-by-side diff before deciding.
- The AI Chat icon in the sidebar shows a count badge while changes are waiting, so you don’t miss them when you’re working in another panel.
The banner only appears on the instant browser runtime. A server-backed app always applies AI changes straight away.
Fix Errors
When a build or runtime error appears in the log panel, an Auto-fix button appears next to the error entry on hover. Clicking it sends the error directly to the AI, which reads the relevant files and writes a targeted fix.
A Fix error shortcut also appears above the chat input for the most recent active error — one click without needing to find the entry in the log.
A Report button appears alongside it. Clicking Report opens the feedback form pre-filled with the error details so you can send a bug report to the cdbx team.
Generate From Scratch
Via the Vibe Coding flow, the AI can generate an entire app from a plain-English description, including picking the right template and writing all the files.
Model Selection
Use the model selector in the bottom-left of the chat input to switch between AI providers (Anthropic, OpenAI, Moonshot AI, and xAI) and models. The selected model applies to the current session, and the same choice carries over to the vibe input and the Planning Agent — they all share one preference.
Each provider offers one model per price level: Claude Haiku 5.5, Sonnet 5.5, Opus 5.5 and Fable 5.1; GPT-6 Luna and GPT-6 Sol; Grok 4.7; and Kimi K3.
Group by at the top of the picker switches between two views, and the picker remembers the one you used last:
- Price (the default) groups models into three tabs by cost:
- Lite — fastest, cheapest models, best for small tweaks
- Economy — a balance of speed and quality, best for most everyday builds
- Power — higher-performance models for complex work
- Provider gives each company its own tab: Claude, OpenAI, Grok and Kimi. Each model’s dots show its price level (three dots for Lite, six for Economy, nine for Power).
Each model shows how fast it uses credits (e.g. “4×”), and a “Recommended” tag on the best default per tab. The number follows what the model costs to run: Claude Sonnet 5.5 is 4×, Claude Haiku 5.5 is 0.2×, Claude Opus 5.5 is 8×. A 4× model uses twice the credits of a 2× one for the same work.
The exact list of models shown reflects what’s currently enabled — new models can appear over time without requiring an update on your end. If a model you had chosen is taken off the list, chats switch to the default model, Claude Sonnet 5.5.
Where each model is available
Each AI company offers its models only in certain countries, and cdbx follows their lists. If you connect from a country a company doesn’t serve, its models are turned off for your account and chat tells you which models you can use instead. Everything that isn’t AI keeps working. If you use your own API key for that company, this doesn’t apply.
How often you can send
On cdbx’s own AI you can send up to 20 requests a minute. If you go past that, chat asks you to wait a minute. Your own API key has no such limit.
Effort
For models that support it (currently Claude models with extended thinking), an Effort slider appears below the model list — Low through Max, five steps. Higher effort gives the model more room to reason before responding, at the cost of a bit more latency and, at the highest levels, a small amount of extra usage (flagged with a ”+” or ”+$”). Lower effort is faster and cheaper, best for simple requests.
When effort is on, a Building row shimmers above the response while the model is reasoning. Click it to expand and read the full thinking transcript — it collapses back to a static “Thought process” label once the turn finishes, staying available to reopen at any time.
API Keys (Bring Your Own Key)
To use AI features, you need to provide your own API key.
To add a key:
- Open Security → BYOK
- In Your AI keys, paste your Anthropic, OpenAI, Moonshot AI, or xAI key on its row and click Save
Keys are stored encrypted and never sent back to your browser. Once saved, the row says Key saved with a green check, and a Remove button. The chat footer shows a BYOK badge (green key icon) or Platform badge (blue shield) to confirm which key is active for the current provider.
You can remove a saved key at any time from the same panel.
Reading a reply
Each reply sits in a box with a strip along its foot:
- Copy copies the reply (when it has several code blocks, a second button copies just the code).
- The model that wrote it, how long it took, the tokens it used and what it cost in credits. Hover the numbers for the full breakdown (tokens in, out and from the cache).
Under a reply that changed your app, “1 file changed · Review” shows which files it touched; click Review to see the list. In Advanced Mode each file opens in the editor.
Next to it, on the latest reply that changed files, Undo this change puts your app back exactly as it was just before that reply, rebuilds the preview and saves. It puts back every file, so any edits you made yourself after that reply go too. Once used it isn’t offered again; older versions are in the Timeline (Advanced Mode). Undo works when the AI applies its changes straight away, the default; if you review each change first, use Reject instead.
Under the latest reply, the AI suggests up to three next steps — for example “Email me when someone books”. Click one to send it.
Your own messages have Copy too, and Copy conversation at the top of the chat copies the whole chat as plain text.
While the AI works, the reply fills in as it goes, with what it’s doing (“Reading index.html…”) and a live timer.
Token Usage
The input/output token count for the current chat session is shown next to the model selector. This gives you a sense of context window usage across the conversation. Each reply’s own tokens and credits are in its strip.
Dashboard Assistant
When you’re on your dashboard (not inside an app), a chat bubble in the bottom-right corner opens a lightweight AI assistant. It answers questions about cdbx — features, how things work, where to find settings — and can direct you to the right docs page.
It is separate from the editor AI Chat and does not have access to your code. To send feedback or report an issue, click the Send Feedback button at the bottom of the assistant panel.
App Context (AGENTS.md)
Every new app includes an AGENTS.md file at the root of the file tree. The AI reads this file at the start of every conversation, so anything you write there applies without you having to repeat it.
Open AGENTS.md and fill in the sections that are relevant to your app:
- Purpose — what the app is building; gives the AI goal alignment
- Conventions — coding style, component patterns, libraries to use or avoid
- Off-limits — files or sections the AI should never modify
Example:
## Purpose
A drag-and-drop kanban board for personal task tracking.
## Conventions
- Tailwind CSS only — no inline styles
- Functional components with hooks
- Keep all state in App.jsx for now
## Off-limits
Never modify index.tsxThe file is pre-filled with template-specific defaults (React conventions for a React app, Go conventions for a Go app, etc.). Edit or delete any section — if the file is blank or deleted, the AI simply uses its default behaviour.
Long tasks and picking up where it left off
A single AI turn can take a limited number of steps — reading a file, writing one, checking something — before it has to stop. A big request can use them all up before the work is done.
cdbx continues on its own. When a turn runs out of steps part-way through, it starts again from where it stopped, up to three times, so a large build carries on without you doing anything. You’ll see it keep working rather than stopping mid-way. It also carries on if a build finishes but your app’s main file still shows the starter placeholder — and if it still isn’t wired up after that, the chat tells you so and asks you to send “continue”.
Two cases where it stops and waits for you instead:
- The turn was taking too long. Carrying on would just run out of time again, so it tells you and suggests asking for something smaller — one page or one component at a time.
- It didn’t manage to change anything. That usually means it’s stuck rather than unfinished, and repeating would waste credits.
Anything already written is kept and still revertable in every case.
Undoing a turn
For a server-backed app, before the AI changes its first file, cdbx saves the previous version of every file it is about to touch. If the result isn’t what you wanted, click Revert this turn on that message and those files go back to exactly how they were.
This works even when a turn goes wrong half-way through — a lost connection, or a turn that ran past the five-minute limit. The changes it did make are kept and still revertable, so you’re never left with a half-finished edit you can’t undo.
A few things to know:
- Revert is one-use per turn. Once you’ve reverted, that snapshot is gone.
- It only covers files that turn touched — your other work is untouched.
- Snapshots live in the app’s own container, so a turn can’t be reverted after the container has restarted.
What a turn costs
Every AI message shows its cost as it runs — token counts and a credit figure that updates each round, not just at the end. A ⚡ figure means part of the conversation was served from cache, which is why follow-up messages usually cost much less than the first one.
You can cap a single turn under Settings → AI Settings → Per-turn credit limit. A turn that reaches the limit stops cleanly and tells you; anything it already changed is kept, and revertable.
Connectors
When you have services connected via Settings → Connectors, the AI can use them automatically. If your request is relevant — searching Notion, reading a GitHub file, checking a Slack channel — the AI calls the connector on its own. You’ll see a progress indicator (e.g. “Searching Notion…”) above the response.
You can also pre-fetch specific content by typing an @-mention in your message:
| Syntax | What it does |
|---|---|
@github:owner/repo/path/to/file.ts | Injects that file’s content into the message |
@notion:search term | Searches Notion and injects the top results |
@google-drive:search term | Searches Drive and injects matching file info |
@slack:channel-name | Injects recent messages from that channel |
The AI also supports push actions when GitHub is connected: “create a repo called…” or “open a PR on owner/repo” trigger the appropriate GitHub flow and return a link.
Actions that change something
Reading from a connected service happens automatically. Anything that writes — posting to Slack, opening a GitHub issue, creating a Notion page — does not. The AI proposes it, you see the exact action and all of its arguments, and it only runs when you click Run it.
This is deliberate. Content the AI reads back from a connected service is written by other people, and text hidden in a page or a message could otherwise talk the AI into doing something on your behalf. cdbx labels everything it reads from a service as content, not instructions, and puts you in the loop before anything leaves your app.
See Connectors for the full setup guide.
Tips
- Be specific — “add a dark mode toggle to the header” works better than “add dark mode”
- The AI always re-reads the current file before writing, so it works with your existing code
- For large changes across multiple files, ask the AI to do them all in one message
- If the AI gets something wrong, just describe the correction — it has the full conversation history
- Put app-wide rules in
AGENTS.mdso you don’t have to repeat them every chat