Skip to content

Connect Roo Code to Tokens

Configure Roo Code's OpenAI Compatible provider for Tokens. The Roo Code repository was archived in May 2026, so this page also points to maintained alternatives.

Works withRoo Code
On this page

Roo Code is a VS Code extension for agentic coding. It connects to Tokens through its OpenAI Compatible provider, which uses the OpenAI Chat Completions protocol against https://tokens.bd/v1.

Roo Code is archived

The RooCodeInc/Roo-Code GitHub repository was archived on 2026-05-15. The last release is v3.54.0 from that date, and the docs moved to roocodeinc.github.io/Roo-Code. The extension still works, but it gets no fixes. If a VS Code update or an API change breaks it, nobody will patch it. For a new setup, use Kilo Code or Cline, which are maintained and connect to Tokens the same way.

If you already have Roo Code set up and want to keep it, the steps below work with Tokens.

Configure the OpenAI Compatible provider in Roo Code#

1. Get a key and a model ID#

Create a key in the dashboard; API keys covers spend caps and allow-lists. This guide uses deepseek/deepseek-v4.1-flash. Other IDs are in the model catalog.

2. Enter the provider settings#

Open the Roo Code panel, go to its settings, and set:

FieldValue
API ProviderOpenAI Compatible
Base URLhttps://tokens.bd/v1
API Keytok_live_your_key
Modeldeepseek/deepseek-v4.1-flash

These match the Roo Code snippet on Connect Your Agent, which fills in your real key.

Roo Code takes the key in its settings field. It doesn't read TOKENS_API_KEY from the environment.

3. Fill in the model configuration#

Roo Code can't learn model limits from the endpoint, so it asks:

  • Context Window. Use the model's context window from the catalog. Roo Code manages conversation length based on this number.
  • Max Output Tokens. The model's output limit or less.
  • Image Support. On only if the model accepts images.
  • Computer Use. Tool use. Leave it on for models that support tool calling.
  • Input/Output Price. Only feeds Roo Code's cost display. Tokens bills from its own meter, and your dashboard usage is the real figure.

Tool calling is required#

Per Roo Code's docs, it uses native tool calling exclusively, with no XML fallback. The model you pick must support OpenAI-style function calling. A model without it will answer in chat but fail as soon as Roo Code tries to read a file or run a command. Check the model's capabilities in the catalog before switching.

Switch models#

Change the Model field to another exact Tokens ID and update the context window and output values. List the IDs your key can use with:

bash
curl -s https://tokens.bd/v1/models -H "Authorization: Bearer $TOKENS_API_KEY"

Choosing a model explains how to pick one for agent work.

Verify it works#

Test the key and model directly:

bash
export TOKENS_API_KEY=tok_live_your_key
curl -s https://tokens.bd/v1/chat/completions \
  -H "Authorization: Bearer $TOKENS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek/deepseek-v4.1-flash", "max_tokens": 16, "messages": [{"role": "user", "content": "Reply with OK"}]}'

Then ask Roo Code to do something that needs a tool, such as "Read package.json and tell me the project name." A successful tool call confirms both the connection and function calling. The request should appear in your dashboard usage analytics.

Troubleshooting#

Errors about tools or tool calls. The model doesn't support native tool calling, or handles it poorly. Pick another model with tool support.

401 invalid_api_key. Wrong, revoked or rotated key. Rotation stops the old secret immediately.

404 model_not_found. The model ID needs the full provider prefix, for example deepseek/deepseek-v4.1-flash.

404 on every request. The base URL must be exactly https://tokens.bd/v1.

403 model_not_allowed_on_key. The key's allow-list excludes the model. Allow-lists are fixed at creation, so create a new key.

429 rate_limited, concurrency_limit or window_exhausted. Per-minute limit, concurrent request limit, or plan usage window. Each response includes Retry-After.

Something broke after a VS Code update. Roo Code won't receive a fix. Move to Kilo Code or Cline; the Tokens settings carry over almost one to one.

See Troubleshooting for every error code and Chat Completions for the request format.

Sources: Roo Code docs, OpenAI Compatible provider (last updated 2026-05-15), RooCodeInc/Roo-Code repository (archived), checked October 2026.

Was this page helpful?

Still stuck? Open a support ticket

Need help configuring your agent?

Test your connection with the connection tester, or create an API key.