AI Agent
The AI Agent is a chat panel built into the Ycode editor. Describe what you want in plain English and the agent builds and edits pages, components, and CMS content directly on the canvas — using your site’s real color variables, fonts, components, and shared styles instead of generic defaults.
Everything the agent does stays a draft until you hit Publish, and every turn has one-click Undo.
Getting Started
On Ycode Cloud, the agent works out of the box. Open a project, switch the right sidebar to Agent, and start chatting — no API key or provider account needed. Usage is paid with AI credits: Free projects get 500 credits to try it, Basic and Pro include monthly credits, and you can top up any time.
On self-hosted Ycode, the agent runs on your own API key from Anthropic, OpenAI, Google Gemini, or xAI (Grok). Add the key once and Ycode routes chat requests through it; you pay your provider directly. Cloud projects can use their own key too.
| Ycode Cloud | Self-hosted | |
|---|---|---|
| Setup | None | Add a provider key |
| Models | Auto, Fast, Best | Any enabled model from your providers |
| Billing | AI credits included with your plan, plus top-ups | Your provider bills you |
| Web access | Search the web, read pages, screenshot websites | Not available |
| Own API key | Optional — replaces credits while connected | Required |
Ycode AI on Cloud
The model picker in the composer offers Auto (the default, which picks the model per request), Fast (quick edits, fewer credits), and Best (highest quality, more credits). Each reply shows roughly what it cost, for example ≈ 12 credits, and the top of the Agent panel shows your remaining balance. See AI Credits for allowances, credit packs, and what happens when you run out.
Use Your Own API Key
On self-hosted Ycode, connect at least one provider key before the agent can chat. On Cloud this is optional: a connected key always takes priority over AI credits, so no credits are used while it’s connected.
Open Agent settings
Go to Settings → Agent in the builder. On Cloud, click Show next to Use your own API key.
Add a provider key
Pick a provider — Anthropic, OpenAI, Google Gemini, or xAI (Grok) — and paste your API key. Click Test to verify it, then Save. Ycode validates the key against the provider’s own endpoint and shows a specific error when a key is blocked or the account is disabled.
Choose a key scope
Each key can be saved as one of:
- Shared with project — Everyone on the project uses this key. Best for a solo builder or a small team sharing usage.
- Only me — The key belongs to your user and takes priority over the shared key when you send messages. Other users on the project fall back to the shared key. Useful when contributors want to bill their own account.
Pick default and allowed models
Enable the specific models you want available in the model picker, and mark one as the Default. Disabled models don’t appear in the chat.
Ycode ships with a curated list per provider — currently Claude Opus 5 (the default), Claude Fable 5, and Claude Sonnet 5 on Anthropic; GPT-5.5 and GPT-5 Mini on OpenAI; the latest Gemini 2.x models on Google; and Grok 4.5 and Grok 4.3 on xAI. Older models like Claude Opus 4.8 are hidden from settings on new projects but stay visible where they were already enabled, so existing workflows don’t break.
Open the Agent tab
Back in the editor, the right sidebar shows an Agent / Human tab switch at the top. Switch to Agent and start chatting. Drag the sidebar’s left edge to give long conversations more room.
Settings → Agent has an Agent in builder toggle to disable the agent entirely. When off, the Agent tab is hidden and the chat API refuses requests — useful for locking down a project or freezing changes during a review.
Chatting with the Agent
Type a message and the agent takes it from there. It streams a markdown reply back as it works, with each tool call rendered inline in the order it happened so you can watch the agent plan and execute.
While the agent is thinking, the chat shows a live status indicator with elapsed time and a rotating description of what it’s doing — no more static “Working…” spinner.
@-mentions
Type @ in the composer to reference something concrete:
- Pages — target a specific page (“update the pricing page…”)
- Collections — point at a CMS collection (“add a new field to @Posts…”)
- Layers — refer to a specific element on the current page
- Components — edit a component master
Mentions render as inline pills, so the agent (and you) know exactly what’s being targeted.
Pick a layer from the canvas
Instead of hunting for a layer name, enter pick mode in the composer and click the layer directly on the canvas. It’s added to the message as a mention.
Attach images and URLs
Drop images or paste URLs into the composer to give the agent extra context — a design reference, a screenshot to replicate, a link to inspiration. Attachments travel with your message. On Ycode Cloud, the agent can also open the links you paste — see Web Access.
Model picker
Switch models on the fly from the composer. On Cloud with AI credits, choose Auto, Fast, or Best. With your own key, the default is whatever you set in Settings → Agent; changing it in the chat only affects that turn onwards.
Usage
On Cloud with AI credits, each reply shows its approximate credit cost and the top of the Agent panel shows your remaining balance — see AI Credits.
With your own key, the composer shows a running badge for the current session: token count in and out, plus an approximate cost. Your provider is the source of truth for billing.
Session history
Conversations persist per project. Open a past session from the history dropdown to keep going, or start a new one for a separate line of work. Every turn records the exact model that produced it, so revisiting a chat shows which model wrote which reply. If a turn failed, the error is persisted too — reloading a transcript no longer hides why a run stopped.
Web Access
On Ycode Cloud, the agent can look things up online and see real websites, so it works from real content and real designs instead of guessing. The chat shows what it’s doing as it goes:
| Status in chat | What the agent does |
|---|---|
| Searching the web | Searches for facts it needs — a business’s opening hours, a product’s features, a company’s address |
| Reading web page | Opens a link and reads its text, so a section can use the page’s real copy |
| Taking screenshot | Captures a public page to see its layout, colors, typography, and imagery |
Paste a URL and ask for what you want:
- “Build an About section using the copy from https://example.com/about ”
- “Recreate the hero from https://example.com ”
- “Make our pricing section look like https://example.com/pricing on mobile”
Screenshots show the first screen by default, at desktop (1280×800) or mobile (390×844) size. For a whole page, ask for a full-page capture; the agent takes up to four images from top to bottom, and up to four screenshots per message. It only screenshots public pages, never your own work in the builder.
The agent remembers what it read for the rest of the conversation, so follow-up messages don’t search again. It also remembers links from earlier messages, and if more than one could match what you mean, it asks which one.
When you give a reference URL or image, the agent recreates that design instead of inventing its own style. If it can’t load a reference site, it doesn’t guess: it makes no edits and asks you to attach a screenshot. Questions like “can you access this URL?” get an answer, not edits.
Web search and page reading work with Ycode AI credits and with your own Anthropic key; screenshots work with every provider. Each search costs about 5 AI credits, and screenshots add to the cost of the message they’re in. Self-hosted Ycode doesn’t include web access — attach a screenshot to the message instead.
Site Analytics
On Ycode Cloud, the agent can read your site’s Analytics and act on it. Ask “Which pages got the most traffic last month?”, “Where do visitors from our newsletter land?”, or “Our pricing page has a high bounce rate. Suggest improvements and make them.” The agent only reads analytics and reports the real numbers; it never estimates them.
Per-Turn Undo and Redo
Every message the agent sends back has a Changes card summarising what it touched. Hit Undo to revert everything from that turn in one click — pages, layers, styles, CMS items, the lot — and Redo to re-apply it. Undo is a single unit per turn, so you don’t have to reverse a dozen small operations by hand.
Because the agent works on drafts, undo never touches the published site.
What the Agent Can Build
The AI Agent shares its tool registry with the MCP Server — the same ~130 tools that external AI clients (Claude, ChatGPT, Cursor, VS Code) use over MCP, minus one: the agent cannot publish. Only you can.
That covers:
- Pages — create, update, duplicate, and design pages; SEO settings; custom code; folders; dynamic pages bound to CMS collections
- Layers — add, move, style, and delete any layer; batch operations across large trees; import from HTML
- Layouts — use the built-in Ycode layout templates as starting points for sections
- CMS — create collections and fields; add, edit, and reorder items; bind fields to layers; filter and sort collection lists
- Components — create, edit, and nest components; variants; text, image, visibility, and ID variable overrides; components inside rich text
- Styles — create and apply Layer Styles; combo-class stacks
- Assets — upload and manage images, videos, and files
- Fonts — search and add Google Fonts
- Localization — locales, translations, translatable pagination text
- Animations — add animation presets or build custom GSAP timelines
- Forms — form settings and submission handling
- Settings — project settings, color variables, redirects
- Globals — site-wide typed variables
See MCP Server for the full tool reference — the same catalog powers the in-app agent.
Design Quality
The agent is trained on Ycode’s design conventions and uses your site’s real design system by default:
- Design system awareness — Before every turn, the agent gets the project’s color variables, fonts, components, and shared Layer Styles injected as context, so new sections match what’s already there instead of inventing new tokens.
- Structural rules — Sections follow the mandated
section → container → contentpattern with sensible spacing, typographic hierarchy, and responsive behaviour. - Design lint — A design-lint pass and a dedicated
design_brieftool push the agent toward consistent typography, spacing, and reuse of existing tokens before it finishes.
Canvas Experience
While the agent works, the canvas gives you live feedback:
- Shimmer overlay — Touched layers glow so you can see what the agent is editing right now
- Streaming sections — New sections stream onto the canvas one by one behind a build skeleton
- Live asset sync — Fonts the agent adds and images it uploads sync into the editor immediately
- Auto-navigation — The canvas auto-opens the page or component the agent is working on
- CMS activity shimmer — Collection edits show an activity shimmer in the CMS view
The final state of every turn is served as an authoritative snapshot with server-compiled Tailwind CSS, so the canvas reflects exactly what will render on the published site.
Draft-First: Nothing Ships Automatically
The agent never publishes. Every page, component, collection change, style, and asset stays in your project draft until you explicitly hit Publish in the builder. The publish popover lists agent-authored changes alongside your own, so you always see what’s about to go live and can undo before it does.
Long Runs and Graceful Timeouts
Very long builds can bump against your hosting platform’s per-request time budget (for example, Vercel’s serverless function limit). Instead of being cut off silently, the agent ends the current turn cleanly before the timeout hits, saves whatever changes it has already made, and shows a resumable “ran out of time” message in the chat. Ask it to keep going in a follow-up message.
Rate Limiting
Each user is limited to about 30 chat requests per minute per project. Above that the API returns a friendly error and asks you to slow down. This is a project-side cap; with your own key, your provider may have its own rate limits.
Troubleshooting
| Issue | Fix |
|---|---|
| Agent tab missing | Agent in builder is turned off in Settings → Agent. Turn it back on. |
| ”No usable key” empty state | Self-hosted only: add a provider key in Settings → Agent and click Test to verify. |
| ”AI credits used” in the composer | Cloud only: your credits are used up. Upgrade, buy a credit pack, or use your own API key — see When You Run Out. |
| Model not appearing in picker | Enable it in Settings → Agent. Only enabled models show up in chat. On Cloud with AI credits, the picker always shows Auto, Fast, and Best. |
| Personal key ignored | Personal keys are per-user. Confirm you’re signed in as the user who saved the key. |
| Rate-limited error | Wait ~60 seconds and retry, or split large tasks across separate turns. |