Skip to content

Connect Continue to Tokens

Add Tokens models to Continue in VS Code or JetBrains with a config.yaml entry: provider openai, apiBase, key, roles, tool use and context length.

Works withContinue
On this page

Continue is an open-source AI code assistant for VS Code and JetBrains, with a CLI as well. It connects to Tokens with its openai provider pointed at a custom apiBase, which sends OpenAI Chat Completions requests to https://tokens.bd/v1. Everything is set in one file, config.yaml.

This guide was checked against Continue v2.0.0 for VS Code (October 2026).

Before you start#

  • Install Continue from the VS Code or JetBrains marketplace (search "Continue").
  • Create a Tokens key in the dashboard. API keys covers spend caps and allow-lists.
  • Pick a model ID from the model catalog. This guide uses deepseek/deepseek-v4.1-flash.

Add Tokens to Continue's config.yaml#

Open ~/.continue/config.yaml and add a model entry. The top-level name, version and schema keys are required.

/.continue/config.yaml
name: Tokens
version: 0.0.1
schema: v1
models:
  - name: DeepSeek V4.1 Flash (Tokens)
    provider: openai
    model: deepseek/deepseek-v4.1-flash
    apiBase: https://tokens.bd/v1
    apiKey: ${{ secrets.TOKENS_API_KEY }}
    roles: [chat, edit, apply]
    capabilities: [tool_use]
    defaultCompletionOptions:
      contextLength: 128000
      maxTokens: 8192

What each part does:

  • provider: openai with apiBase makes Continue send OpenAI-format requests to Tokens instead of OpenAI. Keep /v1 on the end of apiBase.
  • model is the exact Tokens ID, sent upstream as is. The slash in the ID is fine because Continue treats it as a plain string.
  • apiKey uses Continue's ${{ secrets.NAME }} syntax, so the key isn't written into the file. If you prefer, you can put the literal tok_live_your_key here, but then keep config.yaml out of any repository or dotfiles you share.
  • roles decides where the model appears. The allowed values are chat, autocomplete, embed, rerank, edit, apply and summarize.
  • capabilities: [tool_use] tells Continue the model can call tools. Agent mode needs it when Continue can't infer tool support for an unfamiliar model ID, which is likely for gateway IDs.
  • defaultCompletionOptions holds the context window and output limit. The numbers above are examples; use the model's limits from the catalog.

The Connect Your Agent page generates a shorter version of this entry with your key filled in. The fields it uses are the same.

Roles to avoid#

Don't give a Tokens chat model the embed or rerank roles. Tokens' /v1/embeddings endpoint only works for models that are embedding models, so keep whatever embedding provider Continue uses today. Autocomplete is possible with a fast model, but it sends a request on almost every pause in typing, which adds up on a metered key and against the per-minute rate limit.

Switch models#

Add one entry per model under models, each with its own name and model. Continue shows every entry in the model dropdown, so you can switch per chat:

yaml
models:
  - name: DeepSeek V4.1 Flash (Tokens)
    provider: openai
    model: deepseek/deepseek-v4.1-flash
    apiBase: https://tokens.bd/v1
    apiKey: ${{ secrets.TOKENS_API_KEY }}
    roles: [chat, edit, apply]
    capabilities: [tool_use]
  - name: Second model (Tokens)
    provider: openai
    model: provider/model-id
    apiBase: https://tokens.bd/v1
    apiKey: ${{ secrets.TOKENS_API_KEY }}
    roles: [chat]

Replace provider/model-id with a real ID. Check the exact ID in the catalog or with GET /v1/models. Choosing a model helps with the choice.

Verify it works#

Check the key and model directly first:

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 pick "DeepSeek V4.1 Flash (Tokens)" in Continue's chat model dropdown and send a message. To check Agent mode, switch to it and ask Continue to read a file. The request shows up in your dashboard usage analytics.

Troubleshooting#

The model doesn't appear in the dropdown. Continue rejects a config.yaml that is missing name, version or schema, or has a YAML indentation error. Fix the file and reload.

The secret doesn't resolve, or you get 401 missing_api_key. Continue couldn't find a value for secrets.TOKENS_API_KEY. Check Continue's documentation for how secrets are supplied in your setup, or test with the literal key to rule out everything else.

401 invalid_api_key. The key is wrong, revoked or rotated. Rotation stops the old secret immediately.

404 model_not_found. The model value must be the full Tokens ID, for example deepseek/deepseek-v4.1-flash.

404 on every request. Check that apiBase is https://tokens.bd/v1. Don't set useLegacyCompletionsEndpoint; it's only for servers that lack Chat Completions.

Agent mode is unavailable for the model. Add capabilities: [tool_use].

429 rate_limited. Usually autocomplete. Remove the autocomplete role or use a separate key.

More codes are in Troubleshooting, and the request format is in Chat Completions. If you'd rather work in a terminal, Aider and OpenCode use the same endpoint.

Sources: Continue docs, OpenAI provider, config.yaml reference, 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.