VS Code coding agents
Use Plan2API in Cline, Zoo Code (Roo Code fork) and Kilo Code
Cline, Kilo Code and Zoo Code each take Plan2API as an OpenAI Compatible provider: Base URL https://api.plan2api.com/v1, your p2a_ key and a model id such as claude/claude-sonnet-5. Roo Code shut down on May 15, 2026; its community fork Zoo Code keeps the same settings.
- Provider
- OpenAI Compatible
- Base URL
- https://
api.plan2api.com/ v1 - Roo Code
- Shut down May 15, 2026
- Free plan
- 50 chat requests a day
Updated
Settings for Cline, Zoo Code and Kilo Code
All three VS Code agents connect to Plan2API through an OpenAI Compatible provider, including Zoo Code, the community fork that replaced Roo Code. The same Base URL (https://api.plan2api.com/v1) and p2a_ key work in each one, and only the setting field names differ across the extensions.
| Setting | Cline | Zoo Code (Roo fork) | Kilo Code |
|---|---|---|---|
| Where | Settings, API Provider | Settings, API Provider | Settings, Providers, Custom provider |
| Provider | OpenAI Compatible | OpenAI Compatible | Provider API: OpenAI Compatible |
| Base URL | https:// | https:// | https:// |
| Key field | OpenAI Compatible API Key | API Key | API key |
| Model | Model ID list or a custom id | Model | Models, loaded from / |
| Context and output | Model Configuration | Model Configuration | limit in kilo.json |
Set up Cline
- Sign up with a Google account, connect your subscription (Claude, ChatGPT, Google AI Pro or Ultra, or Kimi Code), and copy your
p2a_API key. - Open Cline's settings in VS Code and set
API ProvidertoOpenAI Compatible. - Enter
https://api.plan2api.com/v1in theBase URLfield. - Paste your
p2a_key intoOpenAI Compatible API Key. - Pick a
Model IDfrom the list Cline loads from/models, or choose the custom model ID option and enter an ID such asclaude/claude-sonnet-5. - Open
Model Configuration, setContext Window SizeandMax Output Tokensusing the values in the model table further down, and checkSupports Imageswhen using Claude, Gemini or Kimi models.
Cline v4.1.26 uses the Base URL as entered instead of appending /v1 to a bare host like older builds did, so include /v1 and leave Input Price and Output Price at 0 because Plan2API never bills per token.
Roo Code shut down: use Zoo Code
The Roo Code extension shut down on May 15, 2026 after release v3.54.0, and its GitHub README points users to Zoo Code (a community fork) or to Cline. Zoo Code v3.92.0, released on October 24, 2026, keeps the same OpenAI Compatible setup and field names.
- Open Zoo Code settings and set
API ProvidertoOpenAI Compatible. - Set
Base URLtohttps://api.plan2api.com/v1. - Paste your
p2a_key intoAPI Key. - Select or enter your model ID in
Model, such asclaude/claude-sonnet-5oropenai/gpt-6.1-sol. - Under
Model Configuration, enter the model'sContext WindowandMax Output Tokens(or setMax Output Tokensto-1to let the server decide), and turn onImage Supportfor Claude, Gemini and Kimi models.
Zoo Code relies on native tool calling with no XML fallback, and Plan2API passes OpenAI-style function tools through on Claude, Codex, Gemini and Kimi models.
Zoo Code also has its own ChatGPT Plus/Pro and Kimi Code providers, so Plan2API mainly adds your Claude and Gemini subscriptions and lets you run all four providers off a single key.
Set up Kilo Code
- Click the Settings gear icon in Kilo Code, open the
Providerstab, and add aCustom provider. - Set
Provider IDtoplan2apiandDisplay nametoPlan2API. - Set
Provider APItoOpenAI Compatibleinstead ofOpenAI ResponsesorAnthropic Messages, because Plan2API has no/v1/responsesor/v1/messagesendpoints. - Enter
https://api.plan2api.com/v1inBase URL, and paste yourp2a_key intoAPI key. - Pick the models you want to use from the searchable list that Kilo Code loads from
/v1/models. - Click
Submitto save the provider.
If you use the Kilo CLI, it reads your custom provider configuration from ~/.config/kilo/kilo.json or ./kilo.json and pulls your key from the PLAN2API_KEY environment variable through the env list. Set limit.context and limit.output on every model in kilo.json, because an omitted limit defaults to 0, which switches off context tracking and falls back to a 32,000-token output cap; when you set the default model as <provider-id>/<model-id>, Kilo splits the reference at the first slash, so plan2api/claude/claude-sonnet-5 works cleanly. Put this configuration in kilo.json:
{
"provider": {
"plan2api": {
"npm": "@ai-sdk/openai-compatible",
"env": ["PLAN2API_KEY"],
"options": {
"baseURL": "https://api.plan2api.com/v1"
},
"models": {
"claude/claude-sonnet-5": {
"name": "Claude Sonnet 5",
"limit": { "context": 1000000, "output": 128000 }
},
"claude/claude-haiku-4-5": {
"name": "Claude Haiku 4.5",
"limit": { "context": 200000, "output": 64000 }
}
}
}
},
"model": "plan2api/claude/claude-sonnet-5"
}Model ids and context windows
Always use the exact model IDs returned by GET /v1/models. That endpoint lists every model Plan2API serves, even for providers you haven't connected yet, so picking a model whose provider isn't connected in your vault will return 403 no_credentials. For Claude models, set Max Output Tokens to 128,000, except for claude/claude-haiku-4-5, which takes 64,000. On Kimi, kimi/k3 starts on a 256K window and expands to 1M once the conversation passes about 192K tokens, so entering 1,048,576 for the context window works fine. Here are the model IDs and token limits to enter in your agent's model configuration:
| Model id | Subscription | Context window |
|---|---|---|
| claude/ | Claude Pro or Max | 1,000,000 |
| claude/ | Claude Pro or Max | 1,000,000 |
| claude/ | Claude Pro or Max | 200,000 |
| claude/ | Claude Pro or Max | 200,000 |
| openai/ | ChatGPT plan (Codex) | Listed by GET / |
| gemini/ | Google AI Pro or Ultra | 1,048,576 |
| kimi/ | Kimi Code membership | 1,048,576 |
Plan2API plans for coding agents
A coding agent sends a separate chat request on every model turn, which means a single task with a long chain of file reads and tool calls can burn through dozens of requests. Plan2API Free gives you 50 chat requests per day (resetting at 00:00 UTC), 1 request per second with bursts up to 20, and 4 concurrent requests, which is enough for a quick test run.
For daily agent work, Pro is $12 a month or $99 a year with no daily request cap, 10 requests per second (with bursts up to 600), 16 concurrent requests, and up to 3 connected subscriptions, while Scale is $29 a month or $249 a year for 25 subscriptions and 32 concurrent requests. If you connect more than one account for the same provider, a request that hits a usage limit automatically moves to the next account before any output is sent. Plan2API adds no token quota of its own, so your subscription's usage limits still apply; you can read more about how Claude's own usage limits work, details on running a Claude subscription as an API, and the full breakdown on the Plan2API pricing page.
Troubleshooting
404not_found: YourBase URLis missing/v1and sending requests to/chat/completions, so change the URL tohttps://api.plan2api.com/v1.401invalid_api_key: The API key field is empty, holds the wrong key, or was sent in anx-api-keyheader instead ofAuthorization: Bearerwith a validp2a_key.403no_credentials: Your account has no connected subscription for the provider prefix on that model, so connect that provider in the dashboard or switch to a model from a provider you have connected.400model_not_found: The model ID doesn't match a known model, so pick an exact ID fromGET /v1/modelssuch asclaude/claude-sonnet-5orgemini/gemini-3.8-flash-high.- Kilo Code fails on every request:
Provider APIin your custom provider is set toOpenAI ResponsesorAnthropic Messages, which fail because/v1/responsesand/v1/messagesdon't exist; switchProvider APItoOpenAI Compatible. 429subscription_quota_exhausted: Every connected account for that model's provider has hit its usage quota; wait for the number of seconds in theRetry-Afterheader or connect another account for that provider.429daily_requests: You have used all 50 daily chat requests on the Free plan; wait until the daily counter resets at 00:00 UTC or upgrade your plan.
See the API documentation and full error reference for details on streaming errors and remaining error codes.
Use the AI subscriptions you already pay for as one OpenAI-compatible API key.
- Free: 1 subscription, 50 requests a day, no card
- Pro: $12 a month
FAQ
Is Roo Code still available?
No. The Roo Code extension shut down on May 15, 2026 after v3.54.0, and its README directs users to the community fork Zoo Code or to Cline. Zoo Code uses the exact same OpenAI Compatible settings shown on this page.
Does the Cline Base URL need /v1?
Yes. Cline v4.1.26 uses the Base URL string as entered without adding /v1 automatically, so you must enter https://api.plan2api.com/v1.
Which Provider API should I pick in Kilo Code?
Pick OpenAI Compatible. For chat requests, Plan2API serves POST /v1/chat/completions and does not have /v1/responses or /v1/messages endpoints, so OpenAI Responses and Anthropic Messages won't work.
Can I use my Claude Pro or Max subscription in Cline?
Yes, through Plan2API. Connect your Claude account in the dashboard, set Cline's API Provider to OpenAI Compatible with Base URL https://api.plan2api.com/v1, paste your p2a_ key, and select claude/claude-sonnet-5 or claude/claude-opus-5-5.
Do tool calls work in Zoo Code and Kilo Code through Plan2API?
Yes. Plan2API passes OpenAI-style function tools through on Claude, Codex, Gemini and Kimi models, which Zoo Code needs because it has no XML fallback for tool calls.
Sources
- Cline docs: OpenAI Compatibledocs.cline.bot
- Cline source: Base URL /v1 migrationgithub.com
- Roo Code repository and shutdown noticegithub.com
- Zoo Code docs: OpenAI Compatibledocs.zoocode.dev
- Kilo Code docs: OpenAI Compatiblekilo.ai