ContinueIntegrationCoding agents

Continue.dev with Claude and GPT: Custom API in config.yaml

(prices in the text follow the live price list)

Short answer

To use Continue with APIVAI, open Continue's config.yaml (~/.continue/config.yaml, or %USERPROFILE%\.continue\config.yaml on Windows) and add a model entry with provider: openai, apiBase: https://api.apivai.com/v1 and your APIVAI key as apiKey. Set model to an APIVAI model ID such as claude-sonnet-4-6 or gpt-5.5; the same key and base URL work for both Claude and GPT. For Claude you can also use provider: anthropic with the same apiBase, including /v1, because Continue appends only messages to it. As of 2026-10-07, Claude Sonnet 4.6 costs $1.04 / $5.22 per million input / output tokens through APIVAI, against $3.00 / $15.00 at the official list price.

What is Continue?

Continue is an open-source AI coding assistant for VS Code and JetBrains IDEs. It adds a chat panel, inline edits, an agent mode that can read and change files, and tab autocomplete. Continue is configured in a YAML file, config.yaml; the older config.json format is deprecated. You can point any model entry at your own API endpoint, which is how you connect it to APIVAI and pay per token from a prepaid balance instead of a subscription.

Which provider should you use in Continue?

providerapiBaseModelsWhen to use it
openai (recommended)https://api.apivai.com/v1Claude and GPTOne setup for every model
anthropichttps://api.apivai.com/v1Claude onlyNative Claude format and prompt caching

The /v1 rule in Continue is different from some other tools. Continue joins apiBase with the endpoint name: chat/completions or responses for the openai provider, and messages for the anthropic provider. Continue's own default for the Anthropic provider is https://api.anthropic.com/v1/. So in Continue both providers need apiBase ending in /v1. This is unlike Claude Code or Cline's Anthropic setting, where you enter https://api.apivai.com without /v1. The general details of both formats are on the OpenAI-compatible API and Claude API proxy pages.

For GPT models, Continue's openai provider sends GPT-5 and newer model names to the Responses API (/v1/responses), which APIVAI supports. If a GPT model still fails, add useResponsesApi: false to its entry and Continue uses /v1/chat/completions instead.

How do you set up Continue with APIVAI step by step?

Step 1: Get an APIVAI key

  1. Sign up at apivai.com
  2. Top up your balance from $10 by card, crypto, Alipay or WeChat Pay
  3. Create a key in the Dashboard (you can give it its own budget limit) and copy it

Step 2: Install Continue

Install the Continue extension from the VS Code marketplace, or the Continue plugin from the JetBrains marketplace. Both use the same config.yaml.

Step 3: Open config.yaml

In the Continue panel, open the configs dropdown in the top-right of the chat input and click the cog icon next to Local Config. This opens the local config.yaml. You can also open the file directly: ~/.continue/config.yaml on macOS and Linux, %USERPROFILE%\.continue\config.yaml on Windows.

Step 4: Add the APIVAI models

Paste this, replacing your-apivai-key with your key. If the file already has name, version and schema at the top, keep them and add only the entries under models.

name: My Config
version: 0.0.1
schema: v1

models:
  - name: Claude Sonnet 4.6 (APIVAI)
    provider: openai
    model: claude-sonnet-4-6
    apiBase: https://api.apivai.com/v1
    apiKey: your-apivai-key
    roles:
      - chat
      - edit
      - apply
    defaultCompletionOptions:
      maxTokens: 8192

  - name: GPT-5.5 (APIVAI)
    provider: openai
    model: gpt-5.5
    apiBase: https://api.apivai.com/v1
    apiKey: your-apivai-key
    roles:
      - chat
      - edit
    defaultCompletionOptions:
      maxTokens: 8192

  - name: Claude Haiku 4.5 (APIVAI)
    provider: openai
    model: claude-haiku-4-5
    apiBase: https://api.apivai.com/v1
    apiKey: your-apivai-key
    roles:
      - chat
      - apply
      - summarize

name is only the label you see in Continue; model must be the exact APIVAI ID. maxTokens leaves room for thinking tokens, which are on by default.

Step 5: Save and pick the model

Save the file; Continue reloads the configuration. Choose one of the new models in the model dropdown of the chat panel and send a short test message. If it answers, the setup works. If not, see the troubleshooting section below.

Optional: the Anthropic provider for Claude

  - name: Claude Sonnet 4.6 (APIVAI, Anthropic)
    provider: anthropic
    model: claude-sonnet-4-6
    apiBase: https://api.apivai.com/v1
    apiKey: your-apivai-key
    roles:
      - chat
      - edit
      - apply
    defaultCompletionOptions:
      maxTokens: 8192
      promptCaching: true

promptCaching: true lets Claude cache the system message and conversation history, so repeated context is billed at the cheaper cache-read price.

Settings at a glance

FieldValue
provideropenai (Claude and GPT) or anthropic (Claude)
apiBasehttps://api.apivai.com/v1 for both providers
apiKeyyour APIVAI key
modelan ID from GET /v1/models, e.g. claude-sonnet-4-6
roleschat, edit, apply (not embed or autocomplete)
defaultCompletionOptions.maxTokens8192

Agent mode, autocomplete and embeddings

If Continue says a model cannot be used in agent mode because it does not support tools, add capabilities with - tool_use to that model entry; tool calling works through APIVAI.

APIVAI does not provide embeddings, so do not give APIVAI models the embed role. Features that need an embeddings model require a separate embedding provider; chat, edit, apply and agent mode still run through APIVAI. Tab autocomplete works best with a small, fast fill-in-the-middle model, which Claude and GPT chat models are not designed for, so this guide leaves the autocomplete role to another model of your choice.

Which model should you choose in Continue?

Prices per 1M input / output tokens as of 2026-10-07. The model list changes over time, so take IDs from GET https://api.apivai.com/v1/models or the pricing page rather than copying old names.

Modelmodel valueInputOutputBest for
Claude Sonnet 4.6claude-sonnet-4-6$1.04$5.22Everyday chat and agent work
Claude Sonnet 5.5claude-sonnet-5-5$0.69$3.47Everyday coding, newer Sonnet
Claude Opus 5.5claude-opus-5-5$1.39$6.96Hard bugs, large refactors
Claude Haiku 4.5claude-haiku-4-5$0.35$1.74Apply, summaries, quick questions
GPT-6 Solgpt-6-sol$0.30$1.52Strong GPT option
GPT-6 Lunagpt-6-luna$0.0144$0.0768Very cheap tasks

A practical setup: Claude Sonnet 4.6 for chat and agent mode, Claude Haiku 4.5 for the apply and summarize roles, and Claude Opus 5.5 as an extra entry you switch to for hard problems. Add GPT-5.5 or GPT-6 Sol when you want a second opinion from another model family.

What does Continue cost with APIVAI?

Assumptions: a chat turn sends about 5,000 input tokens (your question, selected code and earlier messages) and gets about 1,000 output tokens back. An agent task makes about 12 requests of 30,000 input and 1,500 output tokens each, because every step resends the files and the conversation. Thinking tokens count as output. With Claude Sonnet 4.6:

  • One chat turn: $0.0104 ($0.03 at the official price).
  • A month of chat, 40 turns a day for 22 workdays (880 turns): $9.17 ($26.40 at the official price).
  • One agent task: $0.468 ($1.35 at the official price). Two a workday for a month (528 requests) add $20.61.

The same month of chat on Claude Haiku 4.5 would be $3.07, and on GPT-6 Luna $0.131. The Dashboard lists every request with its tokens and cost. For editor-by-editor comparisons, see Cursor with your own API key and the terminal-based Aider setup.

How do you fix common Continue errors?

  • 401 Unauthorized: the apiKey is wrong, deleted or out of budget. Check for spaces or quotes copied with the key.
  • 404 Not Found: apiBase is wrong. It must be exactly https://api.apivai.com/v1 for both providers. Without /v1, Continue calls https://api.apivai.com/chat/completions or https://api.apivai.com/messages, which do not exist; with /v1/v1 the path is doubled.
  • Model not found: model must be an exact ID from GET /v1/models, for example claude-sonnet-4-6. The name field does not matter.
  • Empty or cut-off replies: thinking tokens used up the output limit. Set maxTokens to 4096 or more (8192 in the examples above).
  • A GPT model fails while Claude works: add useResponsesApi: false to that entry so Continue uses /v1/chat/completions.
  • 429 Too Many Requests: the default limit is 60 requests per minute per key; agent mode can reach it. Wait a moment, or ask support for a higher limit.
  • Models do not appear: the YAML is invalid. Use spaces, not tabs, keep the indentation shown above, and keep name, version and schema at the top.

More API details are in the docs.

FAQ

Does this work in JetBrains IDEs too?

Yes. The Continue plugin for JetBrains reads the same config.yaml, so the same entries work in IntelliJ IDEA, PyCharm, WebStorm and other JetBrains IDEs.

I still have config.json. What should I do?

config.json is deprecated, and Continue's docs have a migration guide to config.yaml. The values stay the same: provider, model, apiBase and apiKey.

Can one key serve both Claude and GPT?

Yes. One APIVAI key works for every model, with the openai provider for all of them or the anthropic provider for Claude.

Can I use APIVAI for autocomplete or embeddings?

APIVAI does not provide embeddings, so use a separate provider for features that need them. Tab autocomplete is best served by a dedicated small completion model; use APIVAI models for chat, edit, apply and agent mode.

Does APIVAI store my code?

No. Request and response content is not logged; only usage data such as model, tokens and cost is kept for billing.

Create an account, top up from $10 and paste your key into Continue.

Ready to start?

Get your API key in 30 seconds. Pay as you go for Claude and GPT.