Docs menu

Docs / Integrations

Use Cent AI with Continue

Add a Cent AI model to Continue as an OpenAI-compatible model with a base URL, an API key and a model name.

Last updated


Your setup

Fills in YOUR_API_KEY in the code on this page. The key stays in this tab: it is never sent and never saved.

Continue speaks the OpenAI Chat Completions format, so it connects to Cent AI at https://api.cent-ai.dev/v1 and adds /chat/completions itself.

Prerequisites

  • A Cent AI account with balance. See Quickstart.
  • An API key from Keys. It looks like cai_<secret> and is shown once.
  • Continue installed in your editor. The version we tested is at the end of this page.

Configure Continue

Open your local config.yaml from the configs menu in Continue (the gear icon next to the local config). It lives at ~/.continue/config.yaml (on Windows %USERPROFILE%\.continue\config.yaml). Add the model under models:

models:
  - name: Cent AI glm-5.3
    provider: openai
    model: glm-5.3
    apiBase: https://api.cent-ai.dev/v1
    apiKey: YOUR_API_KEY
    roles:
      - chat
      - edit
      - apply
FieldWhat it does
nameThe name Continue shows in its model list. Any text.
provideropenai, for an OpenAI-compatible API.
modelA model name exactly as listed by GET /v1/models.
apiBaseCent AI's OpenAI base URL, with /v1.
apiKeyYour key, cai_<secret>. Replace YOUR_API_KEY.
rolesWhat Continue uses the model for. Chat, edit and apply use chat requests.

The file holds your key, so do not commit it or share it. To add another model, add another entry with a different name and model.

Cent AI serves chat models. Do not give a Cent AI model the embed role: /v1/embeddings is not open yet.

Test it

Check the key and the model name with one request. Replace YOUR_API_KEY with your key.

export CENT_AI_KEY="YOUR_API_KEY"

curl https://api.cent-ai.dev/v1/chat/completions \
  -H "Authorization: Bearer $CENT_AI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.3","messages":[{"role":"user","content":"Hello"}]}'

The response has usage.cost, the amount charged for this request in USD. Then pick "Cent AI glm-5.3" in the Continue chat and send a short message. Each request appears on the Requests page of the dashboard with its tokens per rate and its cost. See Request cost.

Cache continuity

Continue resends the conversation on every turn, so much of the input of a long chat can be read from the model's cache. Cent AI sends the next turns of a conversation to the route that served the previous turn. It uses the session signal a tool sends when there is one; without it, it uses the stable start of the prompt. You do not add anything to your configuration for this.

  • Keep a conversation in one chat and on one model. A new chat or another model starts a new cache.
  • Keep the system message and rules the same during a conversation. A change near the start of the prompt changes everything after it.

Cent AI does not promise a cache hit rate. Cache tokens are charged only when the model reports them. See Prompt caching.

Troubleshooting

To look up a failed request, find the x-request-id of the response on the Requests page. All codes are in 4xx errors and 5xx errors.

401 invalid_api_key

The key in apiKey is wrong, cut off, revoked, or a management key (cai_mgmt_…). Paste the key again, or create a new one in Keys.

402 insufficient_balance

The balance available for this model is empty, or the model is not in your budget pack. Top up or buy a pack. See Balance.

403 ip_not_allowed or model_not_allowed

The key has an IP allowlist without your address, or a model allowlist without the model in config.yaml. Add the address or the model to the key.

404 model_not_found

The model name is not one Cent AI serves. Copy the exact name from Models or GET /v1/models; names from other providers, such as gpt-4o-mini, are not aliases. A :free name works only for today's event model (see Free tokens daily); on any other model, including a previous day's event model, it returns 404.

429 rate_limited, key_limit_exceeded or project_budget_exceeded

  • rate_limited: more than 600 requests per minute on this key. Wait for Retry-After. See Rate limits.
  • rate_limited on a :free name: today's free pool is used up, or the event is off. Retry-After runs to 00:00 UTC; the model's own name stays available at its normal price.
  • key_limit_exceeded: the daily or monthly limit you set on the key was reached.
  • project_budget_exceeded: the budget of the key's project was reached.

501 not_available_yet

The endpoint is not open yet. This usually means a Cent AI model has the embed role. Remove that role from the model.

Stream timeout

If a reply stops with upstream_timeout or upstream_unavailable in the stream, see Stream timeout.