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.

Plan2API values in each extension
SettingClineZoo Code (Roo fork)Kilo Code
WhereSettings, API ProviderSettings, API ProviderSettings, Providers, Custom provider
ProviderOpenAI CompatibleOpenAI CompatibleProvider API: OpenAI Compatible
Base URLhttps://api.plan2api.com/v1https://api.plan2api.com/v1https://api.plan2api.com/v1
Key fieldOpenAI Compatible API KeyAPI KeyAPI key
ModelModel ID list or a custom idModelModels, loaded from /v1/models
Context and outputModel ConfigurationModel Configurationlimit in kilo.json

Set up Cline

  1. 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.
  2. Open Cline's settings in VS Code and set API Provider to OpenAI Compatible.
  3. Enter https://api.plan2api.com/v1 in the Base URL field.
  4. Paste your p2a_ key into OpenAI Compatible API Key.
  5. Pick a Model ID from the list Cline loads from /models, or choose the custom model ID option and enter an ID such as claude/claude-sonnet-5.
  6. Open Model Configuration, set Context Window Size and Max Output Tokens using the values in the model table further down, and check Supports Images when 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.

  1. Open Zoo Code settings and set API Provider to OpenAI Compatible.
  2. Set Base URL to https://api.plan2api.com/v1.
  3. Paste your p2a_ key into API Key.
  4. Select or enter your model ID in Model, such as claude/claude-sonnet-5 or openai/gpt-6.1-sol.
  5. Under Model Configuration, enter the model's Context Window and Max Output Tokens (or set Max Output Tokens to -1 to let the server decide), and turn on Image Support for 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

  1. Click the Settings gear icon in Kilo Code, open the Providers tab, and add a Custom provider.
  2. Set Provider ID to plan2api and Display name to Plan2API.
  3. Set Provider API to OpenAI Compatible instead of OpenAI Responses or Anthropic Messages, because Plan2API has no /v1/responses or /v1/messages endpoints.
  4. Enter https://api.plan2api.com/v1 in Base URL, and paste your p2a_ key into API key.
  5. Pick the models you want to use from the searchable list that Kilo Code loads from /v1/models.
  6. Click Submit to 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:

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:

Plan2API model ids for coding agents
Model idSubscriptionContext window
claude/claude-sonnet-5Claude Pro or Max1,000,000
claude/claude-opus-5-5Claude Pro or Max1,000,000
claude/claude-sonnet-4-6Claude Pro or Max200,000
claude/claude-haiku-4-5Claude Pro or Max200,000
openai/gpt-6.1-solChatGPT plan (Codex)Listed by GET /v1/models
gemini/gemini-3.8-flash-highGoogle AI Pro or Ultra1,048,576
kimi/k3Kimi Code membership1,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

  • 404 not_found: Your Base URL is missing /v1 and sending requests to /chat/completions, so change the URL to https://api.plan2api.com/v1.
  • 401 invalid_api_key: The API key field is empty, holds the wrong key, or was sent in an x-api-key header instead of Authorization: Bearer with a valid p2a_ key.
  • 403 no_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.
  • 400 model_not_found: The model ID doesn't match a known model, so pick an exact ID from GET /v1/models such as claude/claude-sonnet-5 or gemini/gemini-3.8-flash-high.
  • Kilo Code fails on every request: Provider API in your custom provider is set to OpenAI Responses or Anthropic Messages, which fail because /v1/responses and /v1/messages don't exist; switch Provider API to OpenAI Compatible.
  • 429 subscription_quota_exhausted: Every connected account for that model's provider has hit its usage quota; wait for the number of seconds in the Retry-After header or connect another account for that provider.
  • 429 daily_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

  1. Cline docs: OpenAI Compatibledocs.cline.bot
  2. Cline source: Base URL /v1 migrationgithub.com
  3. Roo Code repository and shutdown noticegithub.com
  4. Zoo Code docs: OpenAI Compatibledocs.zoocode.dev
  5. Kilo Code docs: OpenAI Compatiblekilo.ai