Docs

CC Switch

CC Switch swaps Claude Code and Codex between providers from a desktop app. Kunavo goes in as a Custom Configuration — service root, Bearer auth, Anthropic Messages native, no local routing.

Esta documentação está em inglês. Para um guia de início rápido em português, veja:Guia em português — Claude API no Brasil

Three fields and two dropdowns. https://api.kunavo.com as the endpoint, your sk-kn-… key, and — the part most guides omit — leave API Format on Anthropic Messages (Native) and Auth Field on ANTHROPIC_AUTH_TOKEN. Kunavo speaks the Messages API natively, so no local routing is involved on the Claude Code side.

CC Switch → Claude Code tab → Add provider
Provider Name   Kunavo
API Key         sk-kn-...
API Endpoint    https://api.kunavo.com      <- service root, no /v1, no trailing slash

Advanced Options
  API Format    Anthropic Messages (Native) <- the default; do NOT switch
  Auth Field    ANTHROPIC_AUTH_TOKEN (Default)
The endpoint is the service root: no /v1, no trailing slash. Anthropic-style clients append /v1/messages themselves — that is why this field looks different from every OpenAI example, where /v1 belongs in the base URL. Full explanation on the ANTHROPIC_BASE_URL page.

Step by step (Claude Code tab)

  1. Create a key at /app/keys and copy it — it is shown once.
  2. Open CC Switch on the top-level Claude Code tab and click the plus button. Keep the default Custom Configuration rather than a preset.
  3. Fill Provider Name, API Key, and API Endpoint = https://api.kunavo.com.
  4. Expand Advanced Options and confirm API Format is Anthropic Messages (Native) and Auth Field is ANTHROPIC_AUTH_TOKEN (Default). Both are the defaults; the point is to check, not to change.
  5. Save, then Activate. The card should not show a Needs Routing marker — that marker only appears on providers whose protocol has to be translated.

Why there is no “Needs Routing” marker

CC Switch's local route exists to bridge protocols. Claude Code sends Anthropic Messages requests to /v1/messages; a gateway that only exposes OpenAI Chat Completions or the Responses API cannot answer one, so the route converts the request on the way out and converts the response on the way back. That conversion is where streaming events, tool calls and thinking config get re-shaped — it works, and it is one more moving part between your editor and the model.

Kunavo serves POST /v1/messages directly, so on the Claude Code side there is nothing to convert: the provider stays Anthropic Messages (Native) and the route is not in the path at all. It also serves POST /v1/chat/completions and POST /v1/responses under the same key, which is what makes the Codex direction below possible.

CC Switch tabSet the format toLocal routing
Claude CodeAnthropic Messages (Native)Not needed
CodexAnthropic Messages (routing required)Required — the route rewrites /responses to /v1/messages

Running Claude models inside Codex

This is the direction the other provider guides do not cover. Codex talks to the OpenAI Responses API, so pointing it at a /v1/messages endpoint directly returns 404 — CC Switch solves it by keeping Codex on the local route and translating. On the Codex tab there is no Anthropic preset, so this is a Custom Configuration too:

CC Switch → Codex tab → Add provider
Provider Name      Kunavo
API Key            sk-kn-...
API Request URL    https://api.kunavo.com
Default Model      claude-sonnet-4-6

Advanced Options
  Upstream Format  Anthropic Messages (routing required)
CC Switch's own guide adds a warning worth repeating: some providers restrict their Claude API to the Claude Code client, so such a key may error out when used through Codex. Kunavo does not — the same sk-kn-… key serves the Messages face and the Responses face, and there is no client allow-list on either. If you would rather skip the translation entirely, Codex CLI can also point straight at Kunavo's native /v1/responses surface; that path is on the Codex CLI page.

Model mapping

CC Switch maps Claude Code's three tiers onto real model ids. Fill all three plus the Default fallback model — unmatched requests otherwise pass through under the original Claude name and error at the upstream. Rates are USD per 1M tokens, input / output, read live from the catalog.

TierModel idKunavo in / outWhy
Haikuclaude-haiku-4-5$0.40 / $2.00Claude Code routes background sub-tasks here — the cheapest tier is the right one
Sonnetclaude-sonnet-4-6$1.20 / $6.00The working default for editing
Opusclaude-opus-5$2.00 / $10.00Architecture-level changes
Leave the 1M checkbox off unless the tier really serves a one-million-token window. Declaring a context the upstream does not have does not extend anything — it just moves the failure to the middle of a long conversation.

Verify before you debug the app

One pair of requests settles whether a failure is the key, the endpoint or CC Switch. If both return 200, anything still broken is a field in the form — and it is nearly always Auth Field or a /v1 that should not be in the endpoint.

# Settles whether a failure is the key, the endpoint, or CC Switch.
# 200 + a JSON list of model ids means the same key works in the app.
curl -sS https://api.kunavo.com/v1/models \
  -H "Authorization: Bearer sk-kn-..."

# The Anthropic face, which is the one the Claude Code tab actually calls.
curl -sS https://api.kunavo.com/v1/messages \
  -H "Authorization: Bearer sk-kn-..." \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"claude-haiku-4-5","max_tokens":16,
       "messages":[{"role":"user","content":"ping"}]}'

Reference

CC Switch is open source at github.com/farion1231/cc-switch. The field names and behaviour above are from its own guides — the Claude Code routing guide and the Codex routing guide, both of which state they apply to 3.17.0 and later. On older versions the form differs; check the app's About panel if a field named here is missing. Kunavo's side is documented under the Messages API, chat completions and the integrations hub.

FAQ

How do I add a custom provider in CC Switch?

On the Claude Code tab, click the plus button, keep the default Custom Configuration, and fill in Provider Name, API Key and API Endpoint. The API Endpoint is the gateway's service root without a trailing slash — for Kunavo that is https://api.kunavo.com, with no /v1. Then open Advanced Options and check two fields: API Format and Auth Field. Those two decide whether the provider works at all, and they are the two that most setup guides leave out.

Does Kunavo need CC Switch's local routing turned on?

No. Local routing exists to translate between protocols — it converts Claude Code's /v1/messages request into OpenAI Responses or Chat Completions when the upstream only speaks those. Kunavo serves the Anthropic Messages API natively at https://api.kunavo.com/v1/messages, so the API Format stays on the default Anthropic Messages (Native), the provider card never shows the Needs Routing marker, and requests go straight to the upstream. A gateway that only offers Chat Completions has to run the local route for every request.

Why does the API Endpoint have no /v1 when the OpenAI examples do?

Because the two conventions disagree on purpose. Anthropic-style clients append /v1/messages themselves, so they want the origin alone — https://api.kunavo.com. OpenAI SDKs expect /v1 to already be in base_url, so they want https://api.kunavo.com/v1. CC Switch's Claude Code tab is the Anthropic side, so the /v1 is left off. Getting this backwards is the single most common setup failure across every client; the ANTHROPIC_BASE_URL page walks through both shapes.

Should I set the Auth Field to ANTHROPIC_API_KEY?

No — keep the default, ANTHROPIC_AUTH_TOKEN. That default makes CC Switch send Authorization: Bearer <key>, which is what Kunavo expects. Choosing ANTHROPIC_API_KEY makes it send an x-api-key header instead, and the symptom is a 401 or 403 that looks like a bad key when the key is fine.

Can I run Claude models inside Codex through CC Switch?

Yes, and this is the half most provider guides skip. On the Codex tab, add a Custom Configuration with API Request URL https://api.kunavo.com and a Default Model such as claude-sonnet-4-6, then set Upstream Format to Anthropic Messages (routing required) in Advanced Options. Local routing must be on for this direction, because Codex speaks the Responses API and the route rewrites /responses to /v1/messages. CC Switch's own guide warns that some providers restrict their Claude API to the Claude Code client and such keys fail through Codex — Kunavo does not: the same sk-kn- key serves both faces.

Which model ids do I put in CC Switch's model mapping?

Use Kunavo's catalog ids. A good default split is claude-haiku-4-5 ($0.40 / $2.00 per 1M tokens) on the Haiku tier, because Claude Code sends background sub-tasks there; claude-sonnet-4-6 ($1.20 / $6.00) on Sonnet; and claude-opus-5 ($2.00 / $10.00) on Opus. Always fill the Default fallback model as well — CC Switch passes unmatched requests through under the original Claude name if you leave it empty, and those error at the upstream. The live list is at GET /v1/models.

Where does CC Switch put my API key?

In its own store, not in the client's config. CC Switch keeps providers in ~/.cc-switch/cc-switch.db and, when local routing takes a client over, writes only the local route address into ~/.claude/settings.json with a placeholder in the auth entry — the real key is injected by the route at forward time. That is a property of CC Switch, not of Kunavo; it is worth knowing because it means the key you paste is not the key sitting in the file you might be about to commit.