Kilo Code Integration with The Grid | VS Code and CLI Setup
Connect Kilo Code to The Grid in VS Code or the CLI. Add your consumption key, select The Grid, and choose instruments for each mode.
Kilo Code talks to The Grid through its built-in custom-provider flow. The CLI has a /connect shortcut; the VS Code extension exposes the same setup behind a gear icon. Either way, your requests go straight to api.thegrid.ai/v1 with your Grid consumption key, billed against your Grid credits.
Prerequisites
Kilo Code installed (the VS Code extension or the CLI:
npm install -g @kilocode/cli).A Grid account at app.thegrid.ai.
Credits in your account. The Grid is prepaid; zero credits returns 402.
A Grid consumption API key from Settings → API Keys → Create Consumption Key.
Setup
1. Get your Grid consumption API key
Log into app.thegrid.ai. Go to Settings → API Keys → Create Consumption Key and copy it.
2a. CLI: run /connect
kiloInside the TUI, run /connect, select The Grid from the provider list, and paste your consumption key when prompted. Kilo writes the provider config for you.
2b. VS Code: gear icon → Custom provider
In the Kilo Code panel, click the gear icon. In the Providers tab, choose Custom provider and select The Grid. Paste your consumption key and submit. Kilo populates the instrument list automatically.
3. Pick a default instrument
Set your default instrument in the Kilo model picker. code-prime is a good starting point for a coding agent; agent-prime fits agentic tool-use work; the Max tier handles hard architecture or long-horizon planning. The full tier guide lives in the current instruments list.
4. Check the context window per instrument
Kilo Code is part of the Cline/Roo family and needs an accurate context window per model to decide how much it can send. When it reads The Grid's /v1/models, it picks up the window automatically. If you set a model up by hand or override it, set the context window to 128K on the code-prime or agent-prime instruments above and 1M on the Max tier, and keep max output below it. A window larger than the instrument's real one makes Kilo overpack a long task and return a 400. For any other instrument, get its context window from the current instruments list.
5. (Optional) Tier instruments per mode
Kilo Code's Architect, Coder, and Debugger modes each accept their own model. A common split: Code Max for Architect and Debugger, Code Prime for Coder, Code Standard for autocomplete.
Verification
Open a project and ask: "Add a rate limiter middleware to the Express app in src/server.ts and a test for it." If Kilo reads files, writes code, and runs the test, the integration is live.
Troubleshooting
Last updated
Was this helpful?