VS Code SetupIntermediate

How to Configure Continue with an API Model

Add a cloud model such as Claude or GPT to Continue by editing its YAML config and pasting an API key.

9 minIntermediate

Continue does not ship with a model of its own. You point it at one through its config file. This guide adds a cloud model from an API provider, stores the API key safely, and confirms the model answers in the chat panel. The example uses Anthropic's Claude, but the same structure works for other providers.

What you need

  • The Continue extension installed
  • An API key from a model provider, such as the Anthropic Console
  • A small amount of credit on that provider account
  • About 7 minutes

Step 1: Get an API key

Sign in to your provider's console and create a new API key. Copy it once; most providers only show the full key at creation time. Keep it out of any file you commit to version control.

Never commit an API key
An API key in a public repository can be found and abused within minutes. Keep it in the Continue config in your home folder, not in your project, and add .continue to your global gitignore if you ever store config in a repo.

Step 2: Open config.yaml

Open the Continue panel, click the gear icon, and edit the config. The file lives at ~/.continue/config.yaml. The models section is a list, where each entry has a provider, a model id, and an apiKey.

VS Code - editing config.yaml
Explorer
config.yaml
sessions
~/.continue/config.yaml
1models:
2 - name: Claude Sonnet
3 provider: anthropic
4 model: claude-sonnet-4-5
5 apiKey: sk-ant-...
The Continue config opened in the editor.

Step 3: Add the model entry

Add a block under models with the provider, the exact model id from the provider's docs, and your key. The name field is just the label shown in the model picker. Save the file and Continue reloads the config automatically.

~/.continue/config.yaml
models:
  - name: Claude Sonnet
    provider: anthropic
    model: claude-sonnet-4-5
    apiKey: sk-ant-your-key-here
    roles:
      - chat
      - edit
      - apply
Roles split the work
The roles list tells Continue which jobs this model handles. A strong model is good for chat and edit, while a small fast model is better for autocomplete. You can define separate entries for each role.

Step 4: Pick the model and test it

Open the Continue chat panel. At the bottom of the input box is a model dropdown; select the name you set. Ask a simple question to confirm the connection works, such as asking it to explain a snippet of your code.

VS Code - Continue chat
You
Explain what this regex matches: ^\d{3}-\d{4}$
Agent
It matches a string of exactly three digits, a hyphen, then exactly four digits, with nothing before or after, such as a 555-1234 phone number.
A successful first response from the configured model.

Result

Continue now talks to a cloud model using your API key. If a request fails, the most common causes are a typo in the model id, an empty key, or no credit on the provider account. Fix those and the chat responds normally.

Watch related tutorials

Tags
#continue#api#config#models