返回 CodeWhale
PROVIDERS.md
根目录 / docs / PROVIDERS.md
1 # Provider Registry
2
3 > 阅读简体中文版:[zh_hans/PROVIDERS.md](zh_hans/PROVIDERS.md)
4
5 Speech recognition, synthesis, translation and video have separate execution
6 paths. See [media models](MEDIA_MODELS.md) for current support and reviewed
7 upstream candidates; a chat catalogue row alone does not add a media backend.
8
9 This registry describes provider behavior that is wired into the current
10 Codewhale codebase: provider IDs, config keys, auth paths, base URLs, wire
11 dialects, and reasoning controls. How Codewhale stores provider and model data,
12 resolves model IDs (policies, stripped prefixes, aliases, wire slugs, and custom
13 base URLs), derives context windows, output limits, capabilities, and prices
14 from the resolved route, and verifies signed `registry.json` updates is owned in
15 one place: [Models and providers](MODELS_AND_PROVIDERS.md).
16
17 DeepSeek remains the default provider, but every entry in `ProviderKind::ALL`
18 is a first-class selectable provider route. `ALL` is the catalog/picker
19 surface — one identity per vendor. Dual-wire dialect kinds (`*Anthropic`, e.g.
20 `deepseek-anthropic`) and the Model Studio plan variants stay on the enum for
21 serde and `provider_for_kind` but are deliberately **not** catalog rows:
22 a plan is `mode`/`base_url` and a dialect is `wire = openai|anthropic` on the
23 primary provider config (`crates/config/src/provider_kind.rs:221-226`). Hosted
24 routes, generic OpenAI-compatible endpoints, the OpenAI Codex/ChatGPT route,
25 native Anthropic, and local runtimes all run the same terminal harness against
26 the selected provider/model/base URL.
27
28 A host reached over plain Chat Completions is an ordinary named provider,
29 not a `ProviderKind`: enum variants are reserved for distinct *wires*
30 (Anthropic Messages, Codex Responses, Google thought signatures). Any such
31 host is a `[providers.<name>]` table with a base URL, a model, and a key env
32 (`docs/CONFIGURATION.md`); `/provider` and `/setup` keep a "paste a Base URL
33 and a key" path for exactly this. Where available, offerings come from live
34 `GET /v1/models` plus the Codewhale catalog (#5350, #6289).
35
36 Bundled compatible hosts. These ship as descriptor rows in
37 `crates/config/assets/provider_descriptors.json` (compiled in by
38 `crates/config/src/descriptors.rs`): each row says how to reach the host — wire,
39 base URL, key env, aliases — while model IDs come from configured models, the
40 Codewhale catalog, and a live `GET /v1/models` when supported. The example model
41 is only a bootstrap hint. Verify
42 against the vendor's own docs before trusting any value here:
43
44 | Host | Base URL | Example models | API key env |
45 | --- | --- | --- | --- |
46 | Thinking Machines Tinker (beta) | `https://tinker.thinkingmachines.dev/services/tinker-prod/oai/api/v1` | `thinkingmachines/Inkling-2-Small:peft:262144:sampling-nvfp4` | `TINKER_API_KEY` |
47 | SenseNova | `https://token.sensenova.cn/v1` | `deepseek-v4-flash` | `SENSENOVA_API_KEY` |
48 | Baseten | `https://inference.baseten.co/v1` | `deepseek-ai/DeepSeek-V4-Pro` | `BASETEN_API_KEY` |
49 | Groq | `https://api.groq.com/openai/v1` | `llama-3.3-70b-versatile` | `GROQ_API_KEY` |
50 | Cerebras | `https://api.cerebras.ai/v1` | `llama-3.3-70b` | `CEREBRAS_API_KEY` |
51 | Command Code | `https://api.commandcode.ai/provider/v1` | `deepseek/deepseek-v4-flash` | `COMMAND_CODE_API_KEY` |
52 | Alibaba Model Studio (DashScope) | `https://dashscope-intl.aliyuncs.com/compatible-mode/v1` | `qwen3.8-flash` | `DASHSCOPE_API_KEY` |
53 | AICraft | `https://aicraftapi.com/v1` | `claude-4.6-sonnet`; DeepSeek / Claude / Gemini / Qwen / GLM / MiniMax / Doubao families | `AICRAFT_API_KEY` |
54 | Tsubasa | `https://api.tsubasa.sh/v1` | `tsubasa-pro`, `tsubasa-fast` (32,768-token context) | `TSUBASA_API_KEY` |
55 | Cheaper Inference | `https://api.cheaperinference.com/v1` | `gpt-5.4-mini`, `claude-sonnet-5`, `gemini-3.1-pro` | `CHEAPER_INFERENCE_API_KEY` |
56 | Yolo-Auto | `https://yolo-auto.com/v1` | `qwen3.8-flash`; `yolo` / `yolo-small` | `YOLO_AUTO_API_KEY` |
57 | Standard Compute | `https://api.stdcmpt.com/v1` | `standardcompute` (router); `deepseek/deepseek-v4-pro`, `anthropic/claude-sonnet-5.5` | `STANDARDCOMPUTE_API_KEY` |
58 | Wafer | `https://pass.wafer.ai/v1` | `GLM-5.3` (default), `GLM-5.2`, `Kimi-K3`, `DeepSeek-V4-Pro` | `WAFER_API_KEY` |
59 | Runcrate | `https://api.runcrate.ai/v1` | `deepseek-ai/DeepSeek-V4.1-Flash`, `zai-org/GLM-5.3`, `openai/gpt-oss-120b` | `RUNCRATE_API_KEY` |
60 | Opper | `https://api.opper.ai/v3/compat` | `claude-sonnet-4-6`, `gpt-5.4-mini` (pool names); `anthropic/claude-sonnet-4-6` | `OPPER_API_KEY` |
61 | Tencent TokenHub | `https://tokenhub-intl.tencentcloudmaas.com/v1` | `hy4` | `TENCENT_API_KEY` |
62 | LLMTR | `https://llmtr.com/v1` | `minimax/minimax-m3.1-flash`; namespaced `vendor/model` ids, from the live catalog | `LLMTR_API_KEY` |
63 | WorldRouter | `https://inference-api.worldrouter.ai/v1` | `claude-sonnet-5-5`, `deepseek-v4-flash`, `gemini-4-neon` | `WORLDROUTER_API_KEY` |
64 | TrustedRouter | `https://api.trustedrouter.com/v1` | `deepseek/deepseek-v4-flash`, `anthropic/claude-sonnet-4.5`; `trustedrouter/auto` (router) | `TRUSTEDROUTER_API_KEY` |
65 | Prime Intellect | `https://api.pinference.ai/api/v1` | `thinkingmachines/inkling-2-small`, `z-ai/glm-5.4`, `deepseek/deepseek-v4.1-flash-1017` | `PRIME_API_KEY` |
66
67 **Bundled provider criteria:** Built-in rows in `provider_descriptors.json` are
68 reserved for established operators with reliable APIs, public documentation,
69 and clear community demand. Any OpenAI-compatible or Anthropic-compatible
70 endpoint works immediately without a bundled row via `[providers.<name>]` in
71 `config.toml` or `/provider` → Custom.
72
73 Tinker's OpenAI-compatible API and serverless inference are beta. Select
74 Tinker in `/provider` or configure the named route below. Its documented
75 serverless IDs also include `thinkingmachines/Inkling-Small:peft:262144:sampling-nvfp4`
76 and `thinkingmachines/Inkling:peft:262144:sampling-nvfp4`; enter one as the
77 model to use it. The Tinker API also accepts your own sampler checkpoint paths.
78
79 ```toml
80 provider = "tinker"
81
82 [providers.tinker]
83 kind = "openai-compatible"
84 base_url = "https://tinker.thinkingmachines.dev/services/tinker-prod/oai/api/v1"
85 api_key_env = "TINKER_API_KEY"
86 model = "thinkingmachines/Inkling-2-Small:peft:262144:sampling-nvfp4"
87 ```
88
89 Codewhale does not discover a Tinker model roster or verify the key through a
90 model-list endpoint. The configured model appears in the picker; other IDs
91 must be entered explicitly. Cost remains unknown in Codewhale for this route.
92 Tinker documents its default reasoning effort as 0.9; this generic route does
93 not currently send an effort setting. Codewhale has not yet qualified a live
94 Tinker conversation, tool call, or image input. See the vendor's
95 [API documentation](https://tinker-docs.thinkingmachines.ai/tinker/compatible-apis/openai/)
96 and [model list](https://tinker-docs.thinkingmachines.ai/tinker/models/models_and_pricing/).
97
98 AICraft's roster spans DeepSeek, Anthropic Claude, Google Gemini, Qwen, GLM,
99 MiniMax and Doubao ids on its OpenAI-compatible endpoint. The authority is
100 `GET https://aicraftapi.com/v1/models` with your key — pick a model from that
101 list, not from this table.
102 Tsubasa implements only `GET /v1/models` and Chat Completions. Its two public
103 model ids share a 32,768-token context, smaller than the 128,000 tokens Codewhale assumes
104 for an unknown model, so set it on the route after saving:
105 `codewhale config set providers.tsubasa.context_window 32768`.
106
107 Cheaper Inference is an OpenAI-compatible gateway with one key for models from
108 several labs. Model ids are bare, such as `gpt-5.4-mini` or `claude-sonnet-5`.
109 Pricing varies by model and route; consult the provider’s current catalog.
110 The authority is `GET https://api.cheaperinference.com/v1/models` with your key.
111 Docs: <https://cheaperinference.com/docs>.
112
113 Standard Compute offers flat monthly plans with a compute budget. By default,
114 requests return HTTP 402 when it is used; eligible plans can enable Pay as you go
115 to continue with additional prepaid charges. See its
116 [budget policy](https://docs.standardcompute.com/budgets-and-limits).
117 The `standardcompute` model id routes each request across models and providers;
118 vendor-prefixed ids such as `deepseek/deepseek-v4-pro` pin one model. The
119 authority is `GET https://api.stdcmpt.com/v1/models`.
120 Docs: <https://docs.standardcompute.com/quickstart>.
121
122 Wafer is an OpenAI-compatible serverless catalog. Chat Completions go to
123 `https://pass.wafer.ai/v1/chat/completions`. Model ids are case-sensitive and
124 match the public list, such as `GLM-5.3` (the default; Wafer's documented
125 quickstart model), `GLM-5.2`, `GLM-5.3-Flash`, `Kimi-K3`, `Kimi-K3.1-Pro`,
126 `Kimi-K3.1-Pro-US`, `Qwen3.8-27B`, `MiniMax-M3.1-Flash`, `DeepSeek-V4-Pro`,
127 `DeepSeek-V4.1-Flash`, `DeepSeek-V4.1-Flash-1017`, `DeepSeek-V4-Flash-0423`,
128 and `DeepSeek-V4-Flash-0731-Fast`. The authority is the public
129 `GET https://pass.wafer.ai/v1/models`. Zero data retention is on for every
130 request and needs no extra header. Inference requires `WAFER_API_KEY`; a
131 successful public listing does not verify the key. Create the key at
132 [app.wafer.ai](https://app.wafer.ai). Docs:
133 [Serverless](https://docs.wafer.ai/serverless).
134
135 ```toml
136 provider = "wafer"
137
138 [providers.wafer]
139 kind = "openai-compatible"
140 base_url = "https://pass.wafer.ai/v1"
141 api_key_env = "WAFER_API_KEY"
142 model = "GLM-5.3"
143 ```
144
145 Runcrate is an OpenAI-compatible gateway with one key for models from several
146 labs. Model ids are case-sensitive `org/Name` ids such as
147 `deepseek-ai/DeepSeek-V4.1-Flash`. The authority is
148 `GET https://api.runcrate.ai/v1/models`. On a configured Runcrate route,
149 `codewhale models --update --provider runcrate` refreshes this catalog
150 anonymously. Inference requires `RUNCRATE_API_KEY`. A successful public listing
151 leaves the key unverified. [Runcrate quickstart](https://www.runcrate.ai/docs/getting-started/quickstart).
152
153 Opper is an EU-hosted, OpenAI-compatible gateway with 700+ models from 50+
154 providers behind one key. Bare pool names such as `claude-sonnet-4-6` let Opper
155 pick the route per request; a `provider/model` id such as
156 `anthropic/claude-sonnet-4-6` pins one route. Token rates are the model
157 providers' rates with no markup. The authority is
158 `GET https://api.opper.ai/v3/compat/models` with your key.
159 Docs: <https://docs.opper.ai/build/gateway/drop-in-sdks>.
160
161 LLMTR publishes model IDs at <https://llmtr.com/v1/models>. Pick a model that lists `/v1/chat/completions` under `supported_endpoints`. Create a key at <https://llmtr.com/dashboard/keys> and set `LLMTR_API_KEY` for requests. For data residency, check the hosting location stated for that model in the [provider’s data handling guidance](https://llmtr.com/docs/security/).
162
163 WorldRouter is an OpenAI-compatible gateway with Claude, GPT, Gemini, DeepSeek,
164 Kimi and GLM models behind one key. Model ids are unprefixed, such as
165 `claude-sonnet-5-5` or `deepseek-v4-flash`, and the catalog with prices is at
166 <https://www.worldrouter.ai/models>. The authority is
167 `GET https://inference-api.worldrouter.ai/v1/models` with your key.
168 Docs: <https://www.worldrouter.ai/docs/quickstart>.
169
170 TrustedRouter is an OpenAI-compatible gateway with one key for models from
171 several labs. Model ids are vendor-prefixed, such as `deepseek/deepseek-v4-flash`
172 (the default) or `anthropic/claude-sonnet-4.5`; `trustedrouter/auto` routes each
173 request across models. The authority is the public
174 `GET https://api.trustedrouter.com/v1/models`. Inference requires
175 `TRUSTEDROUTER_API_KEY`; a successful public listing does not verify the key.
176 Create the key at [trustedrouter.com](https://trustedrouter.com/console/api-keys).
177 Docs: <https://trustedrouter.com/docs>.
178
179 Prime Intellect Inference (`prime`, aliases `prime-intellect`, `pinference`) is
180 an OpenAI-compatible serverless and gateway endpoint serving Prime-hosted models
181 such as `thinkingmachines/inkling-2-small` (default), `z-ai/glm-5.4`, and
182 `deepseek/deepseek-v4.1-flash-1017` alongside multi-lab gateway models. The
183 authority is the public `GET https://api.pinference.ai/api/v1/models`; Codewhale
184 filters out non-chat embedding, rerank, audio transcription, and decision rows
185 automatically and reads per-million USD rates, limits, modalities, and reasoning
186 metadata from the listing. Inference requires `PRIME_API_KEY` with the Inference
187 permission scope from
188 [app.primeintellect.ai](https://app.primeintellect.ai/dashboard/tokens) (a
189 public listing does not verify the key). For team billing accounts, configure
190 `X-Prime-Team-ID` under `[providers.prime.http_headers]`. Docs:
191 <https://docs.primeintellect.ai/inference/overview>.
192
193 Tencent TokenHub is available as `/provider tencent` (aliases `tokenhub`,
194 `tencent-tokenhub`, and `hunyuan`) on the existing Chat Completions transport.
195 Its stable HY4 model is `hy4`; OpenRouter uses the distinct `tencent/hy4` wire
196 ID. Neither rewrites an explicitly selected `hy4-preview` into the stable model.
197 Tencent documents text/image input, tool calling and reasoning, with a 1M
198 context, 960K maximum input and 64K maximum output. Its authenticated
199 `GET /v1/models` determines account availability. If that response omits limits,
200 the compatible route retains conservative defaults; set
201 `providers.tencent.model_context_windows.hy4` to `1000000` to use the documented
202 window without changing the limits of other models on this gateway.
203 Direct cost remains unknown without a scoped user price declaration: Tencent
204 rates are not borrowed from OpenRouter. No paid endpoint call was used to
205 qualify this descriptor.
206 [Tencent HY4 guide](https://www.tencentcloud.com/document/product/1300/80695).
207
208 OpenRouter's stable `tencent/hy4` row comes from its public catalog: 1,048,576
209 context tokens, 65,536 maximum output, text/image input, tools, structured output,
210 and reasoning efforts `none`, `low`, and `high`. `/model hy4` resolves to that
211 exact ID only on OpenRouter; existing HY3 aliases retain their old selections.
212 Its prices come from OpenRouter's own scoped catalog, not Tencent's direct API.
213
214 The built-in Go descriptor keeps `https://opencode.ai/zen/go/v1` for existing configurations. Authenticated inventory uses `https://opencode.ai/inference/go/v1/models` on that built-in connection.
215
216 OpenCode Zen and OpenCode Go are first-class provider routes, configured like
217 any other provider below; they are not part of this table. In `/provider`,
218 type to filter the list (letters not bound to a row action); `Ctrl+T` probes the
219 selected row's `/models` and records reachability only (a 2xx is not
220 model-ready).
221
222 Sources to keep in sync (full architecture and rules in
223 [Models and providers](MODELS_AND_PROVIDERS.md)):
224
225 - `crates/config/assets/provider_descriptors.json` - built-in and compatible-host
226 labels, defaults, aliases, key-env lists, config/secret slots, credential
227 guidance, and per-provider `models` naming rules (`ids`, `accept`,
228 `strip_prefixes`, `aliases`, `wire_slugs`). `crates/config/build.rs`
229 validates and generates immutable typed views from this data owner.
230 - `crates/config/src/route/resolver.rs` (`resolve_model`) and
231 `crates/config/src/config_resolve.rs` - the single model-ID resolver and
232 shared configured-model selection chain across CLI, TUI, and Runtime API.
233 - `crates/config/src/provider_kind.rs` and `crates/runtime/src/config.rs` -
234 provider identity serde, captured configured provider identities, environment
235 precedence, and Rust route/auth behavior.
236 - `crates/config/assets/catalog_corrections.json` - field holds and the only
237 table of reviewed intrinsic model facts (`thought_signatures_required`,
238 `thinking_can_disable`, transports, reference prices, and source receipts);
239 `crates/config/assets/models_dev.bundled.json` is the offline seed rendered
240 by `scripts/catalog/catalog_models_dev.py` without them.
241 - `crates/engine/src/provider_lake.rs`, `route_budget.rs`, and `pricing.rs` -
242 derive context windows, output limits, capabilities, and prices from the
243 resolved route and catalog offerings.
244 - `config.example.toml` and `docs/CONFIGURATION.md` - user-facing config
245 examples and environment variable reference.
246 - `scripts/check-provider-registry.py` - drift check for canonical provider
247 IDs, live TUI provider IDs, TOML table names, static registry rows, and
248 documented defaults.
249
250 ## Captured Provider Identity
251
252 Presentation names, labels, aliases, and historical wire tags come from
253 `provider_descriptors.json`. `ProviderKind` remains the Rust-owned intrinsic
254 credential, protocol, and region distinction. A configured route captures both
255 its kind and exact table key; a custom table named `openai` stays custom and
256 does not acquire OpenAI credentials or protocol rules from its name. Case is
257 significant for custom keys.
258
259 DeepSeek China preserves three legacy representations: `deepseek_c_n` in released
260 TUI serde wrappers, `deepseek-cn` as its captured route ID, and `deepseek_cn` as
261 its config leaf. Its intrinsic kind and default official API host
262 (`https://api.deepseek.com/beta`) are the same as `deepseek`, while an explicit
263 `[providers.deepseek_cn]` table keeps its own `base_url` and `model` overrides.
264
265 An old custom route without an additive provider ID can resume only with a
266 verified root `base_url` migration into the active `providers.custom` table.
267 That private receipt is bound to the parsed table generation. A table-only,
268 profile-only, conflicting, or later replaced table cannot establish the
269 missing identity; an explicit empty ID is refused. Writes reuse the existing
270 locked config mutation and undo comparison, obtain the fresh migration receipt
271 under that lock, and verify the captured table before changing a leaf.
272
273 In-flight requests retain their captured identity, endpoint, and credential
274 generation. Health lookup cannot treat an opaque credential reference as ready
275 merely because an earlier request used the same authentication class.
276
277 ## Provider Selection
278
279 With no saved model, no `default_text_model`, and no `CODEWHALE_MODEL` or
280 provider-specific model variable, a fresh install runs `deepseek-flash` on the
281 DeepSeek provider. Precedence is the active provider's configured default, then
282 its catalog default — so an explicit `default_text_model` is not silently
283 overridden by whichever model the shipped catalog lists first.
284
285 ### DeepSeek V4.1 Flash
286
287 `deepseek-flash` is DeepSeek's id for its newest Flash model. On 2026-10-17
288 DeepSeek moved it to DeepSeek-V4.1-Flash-1017 with the same API and price.
289 Codewhale uses `deepseek-flash` by default, so it runs the
290 new model without an update:
291
292 1. Create an API key at <https://platform.deepseek.com/api_keys>.
293 2. Run `codewhale`, open `/provider` (or press `F3`), choose DeepSeek and
294 paste the key. Setting `DEEPSEEK_API_KEY` works too.
295 3. Give it a task. To choose the model explicitly, run
296 `codewhale --provider deepseek --model deepseek-flash`, or type
297 `/model deepseek-flash` in a session.
298
299 `deepseek-v4-pro` is DeepSeek's larger model. The retired ids
300 `deepseek-v4-flash` and `deepseek-v4-flash-vision-exp` still answer: DeepSeek
301 serves them with the same Flash model. On this route `web_search` asks
302 DeepSeek's own search first.
303
304 Refresh model catalogs without installing a new Codewhale release:
305
306 ```sh
307 codewhale models --update
308 codewhale models --update --provider openai
309 codewhale models --provider openai --json
310 ```
311
312 `models --update` (also `--refresh`) updates the shared Models.dev metadata
313 and calls each configured provider’s `/models` endpoint. Authenticated
314 endpoints use that provider’s credentials. Bundled public catalog endpoints
315 can be refreshed anonymously. `--provider ID` restricts the refresh to that exact
316 provider, including named custom endpoints. It makes no inference requests
317 and never changes the saved provider or model. A command-line API key is
318 confined to the active provider; other routes are reported as skipped for
319 that invocation.
320
321 Plain `models` lists the active provider's saved catalog without provider requests.
322 For ChatGPT, it validates the selected registration locally before reading
323 that account's saved roster. Successful refreshes are saved under Codewhale's
324 catalog directory and used by the model/provider pickers, except account
325 listings (the Codewhale account, Baseten and plugin account catalogs), which
326 stay in the memory of the process that read them; `exec`, `review` and the
327 workflow tool therefore read the account listing once before their first
328 request, and continue with built-in limits if it cannot be read. Cache files
329 are scoped to provider identity and endpoint; a failed refresh preserves prior
330 rows. Text output reports source, last successful fetch time (Unix seconds),
331 and freshness. `--update --json` adds per-source receipts and aggregate counts;
332 partial failures return a nonzero exit code after writing those receipts.
333 Ordinary `models --json` keeps its model-array format. Bundled/configured
334 fallbacks are not proof that an account can use every listed model.
335
336 ### Sign in with ChatGPT
337
338 The `openai-codex` provider ID now uses OpenAI's official open-source
339 [Sign in with ChatGPT flow](https://developers.openai.com/siwc/token-sharing-open-source).
340 Sign in and refresh the selected account's catalog:
341
342 ```sh
343 codewhale auth chatgpt
344 codewhale models --update --provider openai-codex
345 codewhale --provider openai-codex
346 ```
347
348 Sign-in opens your system browser, uses a loopback callback and PKCE, validates
349 the returned identity, and stores the issued registration and renewable tokens
350 in Codewhale's protected credential storage. Permission to use your ChatGPT
351 plan is separate from identity sign-in. A declined or missing plan grant stops
352 inference; choose another provider explicitly if you want another billing path.
353 `codewhale auth chatgpt-revoke` signs out of the Codewhale-owned session.
354 This experimental implementation retains one active registration. A picker
355 for multiple saved ChatGPT accounts is not implemented yet.
356
357 If the browser succeeds but token verification fails, the error identifies the
358 failed check: signature, issuer, audience, expiry, not-before time, or the
359 exact missing or malformed claim. Expiry and not-before times are checked
360 against the issuer's clock, read from the `Date` header of the issuer's
361 verification-key response, with a 60-second tolerance, so a skewed device
362 clock does not reject a fresh sign-in; when that header is unavailable the
363 device clock is used and the error asks you to synchronize it. A time error
364 also reports how far this device's clock is from the issuer's when the
365 difference exceeds the tolerance. A token signed with a key the first key
366 download lacked triggers one fresh download before verification fails.
367 Other verification failures are not evidence of a plan limitation. Report
368 the error text and Codewhale version; never share tokens, callback codes,
369 credential files or decoded claims. A failed verification does not activate
370 the new registration.
371
372 Model discovery uses your granted bearer token at
373 `GET https://api.openai.com/v1/models`; inference uses the public
374 `POST https://api.openai.com/v1/responses` endpoint. The model picker keeps
375 OpenAI's display labels and order and lists only entries with `visibility: list`.
376 The catalog contains no credentials and is bound to the verified issuer,
377 issued client ID, and account subject. Another account or workspace never
378 inherits those model choices. Missing, invalid, or older-than-one-day rosters
379 are reported explicitly and provide no account entitlement evidence. Run the
380 refresh command after signing in. Neither model discovery nor ordinary listing
381 starts an inference request. Imported Codex CLI tokens and legacy process-token
382 variables cannot authorize this official plan route.
383
384 Eligible requests consume your ChatGPT plan or credits. ChatGPT Plus's
385 five-hour allowance is shared across apps; each app receives no separate
386 allowance. The documented five-hour limit does not apply to Pro. App-specific
387 limits can also apply. Review limits and access in
388 [ChatGPT usage settings](https://chatgpt.com/settings/usage). Codewhale does
389 not silently switch to an API key or another provider when a limit is reached.
390
391 This is an OpenAI preview for open-source/local apps. It does not grant access
392 to ChatGPT conversation history. Requests stream with `store: false` and
393 `stream: true`, while Codewhale retains its own session history and tools.
394 OpenAI-hosted image generation, file search, Code Interpreter, native computer
395 use, hosted MCP/connectors, and Responses `tool_search` are unavailable on this
396 route; Codewhale's own tools use supported function/custom tool calls.
397 The ChatGPT preview requests one function call at a time.
398 See [preview limitations](https://developers.openai.com/siwc/token-sharing-open-source/preview-limitations).
399 Paid or remotely hosted applications require the
400 [commercial partner interest process](https://openai.com/form/sign-in-with-chatgpt-interest/);
401 this local integration is not commercial approval.
402
403 The canonical provider IDs are the entries of `ProviderKind::ALL`
404 (`crates/config/src/provider_kind.rs`), in that order:
405
406 `deepseek`, `nvidia-nim`, `openai`, `atlascloud`, `wanjie-ark`, `volcengine`,
407 `openrouter`, `orcarouter`, `xiaomi-mimo`, `novita`, `fireworks`, `siliconflow`, `arcee`,
408 `siliconflow-CN`, `moonshot`, `sglang`, `vllm`, `ollama`, `ollama-cloud`, `huggingface`,
409 `together`, `qianfan`, `openai-codex`, `anthropic`, `openmodel`, `zai`,
410 `stepfun`, `minimax`, `deepinfra`, `sakana`, `longcat`, `opencode-go`,
411 `opencode-zen`, `meta`, `xai`, `mistral`, `telecomjs`, `modelstudio-token-plan`, `modelscope`,
412 `google`, `edenai`, `zenmux`, `csdn`, `concentrate`, `codewhale`, and `custom`.
413
414 `deepseek-anthropic` is *not* on this list — it is a wire dialect of
415 `deepseek`, reached with `wire = "anthropic"`, not a separate route to select.
416
417 Use any of these surfaces to select a provider:
418
419 - CLI: `codewhale --provider <id>`
420 - TUI: `/provider <id>` or the provider picker
421 - Env: `CODEWHALE_PROVIDER=<id>`; `DEEPSEEK_PROVIDER=<id>` is the legacy alias
422 - Config: `provider = "<id>"`
423
424 `deepseek-cn`, `deepseek_china`, `deepseekcn`, and `deepseek-china` are accepted
425 as legacy aliases with intrinsic kind `deepseek`. By default they do not select
426 a different official host (`https://api.deepseek.com/beta` worldwide), while
427 `deepseek-cn` still honors an explicit `[providers.deepseek_cn]` table override.
428
429 `deepseek_anthropic`, `deepseek-claude`, and `deepseek_claude` select
430 `deepseek-anthropic`, the opt-in DeepSeek route that speaks the Anthropic
431 Messages API at `https://api.deepseek.com/anthropic`. It keeps the normal
432 DeepSeek API key path but uses `x-api-key` plus `anthropic-version: 2023-06-01`
433 instead of Bearer auth. If the key already lives in official DeepSeek Harness
434 (`dsh`) at `$DSH_HOME/.credentials.yaml`, grant read-only access with
435 `codewhale auth external-consent --provider deepseek --mode read-only`.
436 Codewhale never writes that file and only reads `DEEPSEEK_API_KEY`.
437
438 `huggingface`, `hugging-face`, `hugging_face`, and `hf` all select the
439 Hugging Face Inference Providers route. This is the OpenAI-compatible router
440 path for chat/inference, not Hub browsing, model-card inspection, uploads, or
441 artifact export.
442
443 `telecomjs`, `telecom-js`, `telecom_js`, `telecomjs-cn`, and `tokenhub` all
444 select the TelecomJS TokenHub route. Its authenticated `/models` catalog is
445 key-scoped and remains isolated from every other provider's live snapshot.
446
447 Fresh shared config writes to `~/.codewhale/config.toml`. Existing
448 `~/.deepseek/config.toml` files are still read for compatibility.
449
450 ### Legacy Antigravity tombstone
451
452 Antigravity is not a Codewhale provider and cannot be selected or run. Existing
453 legacy Antigravity provider state is recognized only as a non-runnable migration
454 tombstone. Run `codewhale auth clear --provider antigravity` to forget only
455 Codewhale-owned legacy configuration and consent metadata. This does not sign
456 out of, revoke, read, or otherwise alter any official Google or Antigravity
457 session. For Gemini, select the supported `google` provider and supply
458 `GEMINI_API_KEY`.
459
460 ### Wire Protocol Compatibility
461
462 Provider selection is explicit. A model string prefix such as
463 `deepseek-ai/...`, `deepseek/...`, `qwen/...`, or `arcee-ai/...` is a
464 provider-owned wire ID or catalog namespace hint under the selected provider.
465 It is not a provider switch and must not be treated as proof that the route is
466 DeepSeek, OpenRouter, or any other provider.
467
468 Set the route with `provider = "<id>"`, `CODEWHALE_PROVIDER=<id>`, or
469 `codewhale --provider <id>`. Set the request model with `CODEWHALE_MODEL`, a
470 provider-specific model env var, top-level `default_text_model`, or
471 `[providers.<table>].model`. Set the endpoint with `CODEWHALE_BASE_URL`, a
472 provider-specific base URL env var, or `[providers.<table>].base_url`. Set auth
473 with `codewhale auth set --provider <id>`, `[providers.<table>].api_key`, or
474 the listed provider env vars.
475
476 | Provider ID | TOML table | Wire protocol | Auth env vars |
477 | --- | --- | --- | --- |
478 | `deepseek` | `[providers.deepseek]` | Model-aware: Responses default (`deepseek-flash`); Chat Completions (`deepseek-v4-pro`) | `DEEPSEEK_API_KEY` |
479 | `deepseek-anthropic` | `[providers.deepseek_anthropic]` | Anthropic Messages | `DEEPSEEK_API_KEY` |
480 | `nvidia-nim` | `[providers.nvidia_nim]` | OpenAI Chat Completions | `NVIDIA_API_KEY`, `NVIDIA_NIM_API_KEY` |
481 | `openai` | `[providers.openai]` | OpenAI Chat Completions | `OPENAI_API_KEY` |
482 | `atlascloud` | `[providers.atlascloud]` | OpenAI Chat Completions | `ATLASCLOUD_API_KEY` |
483 | `wanjie-ark` | `[providers.wanjie_ark]` | OpenAI Chat Completions | `WANJIE_ARK_API_KEY`, `WANJIE_API_KEY`, `WANJIE_MAAS_API_KEY` |
484 | `volcengine` | `[providers.volcengine]` | OpenAI Chat Completions | `VOLCENGINE_API_KEY`, `VOLCENGINE_ARK_API_KEY`, `ARK_API_KEY` |
485 | `openrouter` | `[providers.openrouter]` | OpenAI Chat Completions | `OPENROUTER_API_KEY` |
486 | `xiaomi-mimo` | `[providers.xiaomi_mimo]` | OpenAI Chat Completions | `XIAOMI_MIMO_TOKEN_PLAN_API_KEY`, `MIMO_TOKEN_PLAN_API_KEY`, `XIAOMI_MIMO_API_KEY`, `XIAOMI_API_KEY`, `MIMO_API_KEY` |
487 | `novita` | `[providers.novita]` | OpenAI Chat Completions | `NOVITA_API_KEY` |
488 | `fireworks` | `[providers.fireworks]` | OpenAI Chat Completions | `FIREWORKS_API_KEY` |
489 | `siliconflow` | `[providers.siliconflow]` | OpenAI Chat Completions | `SILICONFLOW_API_KEY` |
490 | `arcee` | `[providers.arcee]` | OpenAI Chat Completions | `ARCEE_API_KEY` |
491 | `siliconflow-CN` | `[providers.siliconflow_cn]` | OpenAI Chat Completions | `SILICONFLOW_API_KEY` |
492 | `moonshot` | `[providers.moonshot]` | OpenAI Chat Completions | `MOONSHOT_API_KEY`, `KIMI_API_KEY` |
493 | `sglang` | `[providers.sglang]` | OpenAI Chat Completions | `SGLANG_API_KEY` |
494 | `vllm` | `[providers.vllm]` | OpenAI Chat Completions | `VLLM_API_KEY` |
495 | `ollama` | `[providers.ollama]` | Local OpenAI-compatible Chat Completions | `OLLAMA_API_KEY` (optional; only for an authenticated local route) |
496 | `ollama-cloud` | `[providers.ollama_cloud]` | Hosted OpenAI-compatible Chat Completions | `OLLAMA_CLOUD_API_KEY`, `OLLAMA_API_KEY` |
497 | `huggingface` | `[providers.huggingface]` | OpenAI Chat Completions | `HUGGINGFACE_API_KEY`, `HF_TOKEN` |
498 | `modelscope` | `[providers.modelscope]` | OpenAI Chat Completions | `MODELSCOPE_API_KEY` |
499 | `together` | `[providers.together]` | OpenAI Chat Completions | `TOGETHER_API_KEY` |
500 | `qianfan` | `[providers.qianfan]` | OpenAI Chat Completions | `QIANFAN_API_KEY`, `BAIDU_QIANFAN_API_KEY` |
501 | `openai-codex` | `[providers.openai_codex]` | OpenAI Responses | Official Sign in with ChatGPT (`codewhale auth chatgpt`) with a validated Codewhale-owned plan grant |
502 | `anthropic` | `[providers.anthropic]` | Anthropic Messages | `ANTHROPIC_API_KEY` |
503 | `openmodel` | `[providers.openmodel]` | Anthropic Messages | `OPENMODEL_API_KEY` |
504 | `zai` | `[providers.zai]` | OpenAI Chat Completions | `ZAI_API_KEY`, `Z_AI_API_KEY` |
505 | `stepfun` | `[providers.stepfun]` | OpenAI Chat Completions | `STEPFUN_API_KEY`, `STEP_API_KEY` |
506 | `minimax` | `[providers.minimax]` | OpenAI Chat Completions | `MINIMAX_API_KEY` |
507 | `deepinfra` | `[providers.deepinfra]` | OpenAI Chat Completions | `DEEPINFRA_API_KEY`, `DEEPINFRA_TOKEN` |
508 | `sakana` | `[providers.sakana]` | OpenAI Chat Completions | `FUGU_API_KEY`, `SAKANA_API_KEY` |
509 | `longcat` | `[providers.longcat]` | OpenAI Chat Completions | `LONGCAT_API_KEY` |
510 | `opencode-go` | `[providers.opencode_go]` | Chat Completions, Responses, or Messages | `OPENCODE_GO_API_KEY` |
511 | `opencode-zen` | `[providers.opencode_zen]` | Model-aware: OpenAI Responses, Anthropic Messages, or OpenAI Chat Completions | `OPENCODE_ZEN_API_KEY`, `OPENCODE_API_KEY` |
512 | `meta` | `[providers.meta]` | OpenAI Chat Completions | `META_MODEL_API_KEY`, `MODEL_API_KEY` |
513 | `telecomjs` | `[providers.telecomjs]` | OpenAI Chat Completions | `TELECOMJS_API_KEY` |
514 | `xai` | `[providers.xai]` | OpenAI Chat Completions | `XAI_API_KEY` |
515 | `mistral` | `[providers.mistral]` | OpenAI Chat Completions | `MISTRAL_API_KEY` |
516 | `google` | `[providers.google]` | OpenAI Chat Completions (official Gemini OpenAI-compat route; captures and replays thought signatures on tool calls) | `GOOGLE_API_KEY`, `GEMINI_API_KEY` |
517 | `edenai` | `[providers.edenai]` | OpenAI Chat Completions | `EDENAI_API_KEY` |
518 | `zenmux` | `[providers.zenmux]` | OpenAI Chat Completions | `ZENMUX_API_KEY` |
519 | `csdn` | `[providers.csdn]` | OpenAI Chat Completions | `CSDN_API_KEY` |
520 | `concentrate` | `[providers.concentrate]` | OpenAI Responses (`/v1/responses`) | `CONCENTRATE_API_KEY` |
521 | `codewhale` | `[providers.codewhale]` | Model-aware: OpenAI Chat Completions (`/v1/chat/completions`) or Anthropic Messages (`/v1/messages`), chosen per model by the account catalog | `CODEWHALE_API_KEY` |
522 | `modelstudio-token-plan` | `[providers.modelstudio_token_plan]` | OpenAI Chat Completions | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` |
523 | `modelstudio-token-plan-anthropic` | `[providers.modelstudio_token_plan_anthropic]` | Anthropic Messages | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` |
524 | `modelstudio-coding-plan` | `[providers.modelstudio_coding_plan]` | OpenAI Chat Completions | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` |
525 | `modelstudio-coding-plan-anthropic` | `[providers.modelstudio_coding_plan_anthropic]` | Anthropic Messages | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` |
526
527 Default base URLs and models for each route are listed in the shipped provider
528 table below. The wire protocol values above are derived from
529 `crates/config/src/provider.rs`: `ChatCompletions` is the default,
530 `openai-codex` overrides to `Responses`; `deepseek-anthropic`, `anthropic`, and
531 `openmodel` override to `AnthropicMessages`; `opencode-zen` resolves the
532 protocol from the selected model's curated offering; and `deepseek` is
533 model-aware — the shipped default `deepseek-flash` (and legacy
534 `deepseek-v4-flash`) rides the Responses endpoint while `deepseek-v4-pro`
535 stays on Chat Completions.
536
537 ## Auth And Env Rules
538
539 For hosted providers, `codewhale auth set --provider <id>` saves an API key for
540 that provider. API-key environment variables are fallback inputs after saved
541 config and keyring credentials; an explicit process-level `--api-key` still
542 wins for that launch.
543
544 For base URL and model selection, prefer:
545
546 - `CODEWHALE_BASE_URL` / `CODEWHALE_MODEL` for the active provider.
547 - Provider-specific base URL/model env vars when listed below.
548 - `DEEPSEEK_BASE_URL`, `DEEPSEEK_MODEL`, and `DEEPSEEK_DEFAULT_TEXT_MODEL` as
549 legacy aliases.
550
551 Non-local `http://` base URLs are rejected unless
552 `DEEPSEEK_ALLOW_INSECURE_HTTP=1` is set. Loopback HTTP URLs are allowed for
553 self-hosted runtimes.
554
555 ## Custom DeepSeek-Compatible Endpoints
556
557 Most custom DeepSeek-compatible deployments can use an existing provider ID.
558 Do not create `[providers.deepseek_custom]`; the provider table names are fixed.
559 Instead, choose the closest shipped route and override its endpoint/model:
560
561 - DeepSeek-compatible hosted API: keep `provider = "deepseek"` and set
562 `[providers.deepseek].base_url` plus `[providers.deepseek].model`, or launch
563 with `DEEPSEEK_BASE_URL` and `DEEPSEEK_MODEL`.
564 - Generic OpenAI-compatible gateway: use `provider = "openai"` with
565 `[providers.openai].base_url` plus `[providers.openai].model`, or launch with
566 `OPENAI_BASE_URL` and `OPENAI_MODEL`.
567 - Multiple named OpenAI-compatible gateways, or local routes you want to pin
568 from an AgentProfile, can use a custom table such as
569 `[providers.lm-studio] kind = "openai-compatible"` and select it with
570 `provider = "lm-studio"` or a profile `provider = "lm-studio"`. Such a table
571 speaks Chat Completions unless it sets `wire = "responses"` (OpenAI
572 Responses at `<base_url>/responses`) or `wire = "anthropic"`.
573 - Local OpenAI-compatible runtimes: use `provider = "vllm"`, `"sglang"`, or
574 `"ollama"` with the matching provider-specific base URL/model values.
575
576 Example user config for a DeepSeek-compatible host:
577
578 ```toml
579 provider = "deepseek"
580
581 [providers.deepseek]
582 api_key = "YOUR_API_KEY"
583 base_url = "https://your-provider.example/v1"
584 model = "deepseek-ai/DeepSeek-V4-Pro"
585 ```
586
587 Example user config for a generic gateway:
588
589 ```toml
590 provider = "openai"
591
592 [providers.openai]
593 api_key = "YOUR_GATEWAY_API_KEY"
594 base_url = "https://gateway.example/v1"
595 model = "your-deepseek-compatible-model"
596 ```
597
598 Alibaba Cloud Model Studio (Bailian / DashScope) is a first-class provider with
599 two plan profiles: Token Plan (Personal / Team) and Coding Plan.
600 Both plans expose an OpenAI-compatible Chat Completions endpoint and an
601 Anthropic-compatible Messages endpoint.
602
603 **Token Plan** (Personal and Team share the same AP-Southeast endpoint):
604
605 ```toml
606 provider = "modelstudio-token-plan"
607
608 [providers.modelstudio_token_plan]
609 api_key = "YOUR_MODELSTUDIO_API_KEY"
610 # base_url defaults to https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
611 model = "qwen3.8-max" # or qwen3.7-plus | qwen3.7-max |
612 # qwen3.6-flash | deepseek-v4-pro | deepseek-v4-flash-0731 |
613 # glm-5.2
614 ```
615
616 **Coding Plan** (separate international endpoint):
617
618 ```toml
619 provider = "modelstudio-coding-plan"
620
621 [providers.modelstudio_coding_plan]
622 api_key = "YOUR_MODELSTUDIO_API_KEY"
623 # base_url defaults to https://coding-intl.dashscope.aliyuncs.com/v1
624 model = "qwen3.8-max"
625 ```
626
627 **Anthropic-compatible dialect** — both plans also expose a native Anthropic
628 Messages path. Select it with the `-anthropic` provider suffix:
629
630 ```toml
631 provider = "modelstudio-token-plan-anthropic"
632
633 [providers.modelstudio_token_plan_anthropic]
634 api_key = "YOUR_MODELSTUDIO_API_KEY"
635 # base_url defaults to https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
636 model = "qwen3.8-max"
637 ```
638
639 Create or copy a Model Studio API key from the
640 [Bailian console](https://bailian.console.aliyun.com/). The API key is shared
641 across all four provider IDs above; only the base URL and wire protocol differ.
642
643 **Thinking / reasoning.** Reasoning surfaces in the TUI's Thinking view on both
644 dialects, per Model Studio's
645 [deep-thinking docs](https://www.alibabacloud.com/help/en/model-studio/deep-thinking).
646
647 On the OpenAI-compatible routes the top-level controls are **route- and
648 model-specific**, and Codewhale fails closed: they are sent only when the
649 configured `base_url` is an official Alibaba Chat Completions host
650 (`*.maas.aliyuncs.com/compatible-mode/v1`, including workspace-scoped hosts, or
651 `coding-intl.dashscope.aliyuncs.com/v1`). A custom `base_url` on the same
652 provider ID gets `thinking`, `enable_thinking`, `preserve_thinking`, and
653 `reasoning_effort` stripped, so an arbitrary OpenAI-compatible gateway is never
654 handed Alibaba's dialect. On a verified host:
655
656 - **Hybrid models** (`qwen3.7-*`, `qwen3.6-*`, `deepseek-v4*`, `glm-*`,
657 `kimi-k2.6*`) get `enable_thinking`: `false` for `off`, `true` otherwise.
658 - **Thinking-only models** — `qwen3.8-max` (catalogued `thinking: always_on`)
659 and `kimi-k2.7-code` — get **no** enable/disable switch at all. Sending one is at
660 best ignored.
661 - `preserve_thinking` is sent for the models documented to accept it
662 (`qwen3.7-max`/`-plus`, `qwen3.6-max-preview`/`-plus`/`-flash`, `kimi-k2.6*`,
663 `kimi-k2.7-code`), so the next turn keeps the assistant's trace.
664 - `reasoning_effort` is sent only for the two families with a documented ladder
665 — `deepseek-v4*` and `glm-5`/`5.1`/`5.2` — mapped to `high` or `max`.
666
667 Reasoning streams back as `delta.reasoning_content`. It is replayed to the
668 provider on later turns only for the `preserve_thinking` models above and the
669 thinking-only models; `deepseek-v3.1`, `deepseek-v3.2`, and `glm-*` history
670 stays stripped pending live confirmation that DashScope accepts
671 `reasoning_content` in input messages. (`deepseek-v4*` replays regardless — the
672 DeepSeek thinking-mode contract requires it on every provider.)
673
674 On the Anthropic-compatible routes, thinking uses the documented
675 `{"type":"enabled","budget_tokens":N}` / `{"type":"disabled"}` shapes from the
676 [Anthropic-compatible Messages API](https://www.alibabacloud.com/help/en/model-studio/anthropic-api-messages),
677 with `budget_tokens` derived from the effort level.
678
679 DeepSeek (`deepseek-v4-pro`, `deepseek-v4-flash-0731`) and GLM (`glm-5.2`)
680 models served by Model Studio are provider-scoped and do not collide with the
681 first-party DeepSeek or Zhipu/Z.ai routes. Model Studio publishes no `glm-5.3`
682 entry, so Codewhale does not offer one on this route.
683 Pay-as-you-go workspace-id templating is not yet in the built-in provider; use
684 a custom provider entry for that plan until a follow-up adds it.
685
686 Private gateways with broken or intercepted certificates should use
687 `SSL_CERT_FILE` with a trusted CA bundle. The legacy
688 `insecure_skip_tls_verify = true` key is still parsed so `codewhale doctor --full` can
689 report stale configs, but provider clients reject it instead of skipping TLS
690 certificate verification.
691
692 Keep `provider`, `api_key`, and `base_url` in user config or process
693 environment. Project-local config overlays intentionally cannot set those keys,
694 so a repository cannot silently redirect prompts or credentials to another
695 endpoint.
696
697 ## Local Models (DS4, Ollama, vLLM, SGLang)
698
699 Self-hosted OpenAI-compatible runtimes are first-class routes and are keyless
700 by default — set an API key only when your server requires one. Start your
701 runner, then point Codewhale at it with `--provider` / `/provider` or a config
702 table.
703
704 | Runner | Default base URL | Default model | Base URL override |
705 | --- | --- | --- | --- |
706 | `ollama` | `http://localhost:11434/v1` | live tag from `GET /v1/models` (pre-refresh: `unknown`) | `OLLAMA_BASE_URL` |
707 | `vllm` | `http://localhost:8000/v1` | `deepseek-ai/DeepSeek-V4-Pro` | `VLLM_BASE_URL` |
708 | `sglang` | `http://localhost:30000/v1` | `deepseek-ai/DeepSeek-V4-Pro` | `SGLANG_BASE_URL` |
709
710 ### DS4 (DwarfStar)
711
712 [DS4](https://github.com/antirez/ds4/tree/84cc882352757baf628a1776badf7cc54d584e28)
713 serves DeepSeek V4 Flash and Pro locally
714 through an OpenAI-compatible API. Start DS4, then open Codewhale's prefilled,
715 keyless setup form:
716
717 ```bash
718 ./ds4-server --ctx 100000 --kv-disk-dir /tmp/ds4-kv --kv-disk-space-mb 8192
719 codewhale
720 # In Codewhale: /setup provider ds4
721 ```
722
723 Review the prefilled route and press Enter to save it. The preset budgets a
724 100,000-token context to match that starter command and defaults to the Flash
725 compatibility alias. Check the local route explicitly with
726 `codewhale doctor --probe-local`.
727
728 DS4 loads the actual GGUF when the server starts. Its `deepseek-v4-flash` and
729 `deepseek-v4-pro` API ids are compatibility aliases; changing `/model` does
730 not swap the resident model. To run Pro, download the supported Pro weights
731 and start `ds4-server -m <pro.gguf> ...` as described by DS4. Update
732 `context_window` whenever the server's `--ctx` value changes.
733
734 The equivalent config is:
735
736 ```toml
737 provider = "ds4"
738
739 [providers.ds4]
740 kind = "openai-compatible"
741 base_url = "http://127.0.0.1:8000/v1"
742 model = "deepseek-v4-flash"
743 auth_mode = "none"
744 context_window = 100000
745 ```
746
747 Codewhale reuses its existing OpenAI-compatible transport and DeepSeek
748 reasoning/tool-call shaping for DS4. It does not invent an API key, confuse an
749 API alias with the loaded GGUF, or silently switch to a hosted DeepSeek route.
750 The pinned DS4 [agent-client contract](https://github.com/antirez/ds4/blob/84cc882352757baf628a1776badf7cc54d584e28/README.md#agent-client-usage)
751 documents Chat Completions at `/v1`, DeepSeek thinking replay, streamed usage,
752 `max_tokens`, and no strict-tool mode; Codewhale follows those exact route
753 facts instead of inheriting unsupported capabilities from a generic gateway.
754 The primary sources for model-facing behavior are DeepSeek's official
755 [thinking-mode](https://api-docs.deepseek.com/guides/thinking_mode),
756 [tool-call](https://api-docs.deepseek.com/guides/tool_calls), and
757 [Chat Completion](https://api-docs.deepseek.com/api/create-chat-completion)
758 contracts. The pinned
759 [DeepSeek Harness adapter](https://github.com/deepseek-ai/deepseek-harness/blob/47f943859bef60e4160492346772ded9b24f765a/packages/llm/llm-deepseek/README.md)
760 is only a secondary implementation cross-check; it is not the API contract.
761
762 ### Ollama
763
764 ```bash
765 ollama serve # if not already running
766 ollama pull <model> # e.g. deepseek-v4-flash, or any tag you prefer
767 codewhale --provider ollama --model <model>
768 ```
769
770 Provider-hinted model names are sent as-is, so `--model qwen3:8b` works with
771 any tag Ollama has pulled.
772
773 ### Ollama Cloud
774
775 Ollama Cloud is a separate hosted provider. It uses the authenticated
776 OpenAI-compatible `/v1/chat/completions` route and defaults to `gpt-oss:120b`:
777
778 ```toml
779 provider = "ollama-cloud"
780
781 [providers.ollama_cloud]
782 base_url = "https://ollama.com/v1"
783 model = "gpt-oss:120b"
784 ```
785
786 Create a key in [Ollama account settings](https://ollama.com/settings/keys),
787 then run `codewhale auth set --provider ollama-cloud`. For ambient auth,
788 `OLLAMA_CLOUD_API_KEY` wins over Ollama's official `OLLAMA_API_KEY`.
789 `OLLAMA_CLOUD_BASE_URL` and `OLLAMA_CLOUD_MODEL` override the Cloud defaults;
790 arbitrary provider-owned model IDs pass through unchanged. Local `ollama`
791 remains a separate, keyless-by-default provider.
792
793 Compatibility is read-only and in memory: a released config that selected
794 `provider = "ollama"` with the exact normalized
795 `[providers.ollama] base_url = "https://ollama.com/v1"` tuple is treated as
796 `ollama-cloud` at runtime. Only that exact tuple may fall back to the legacy
797 `ollama` secret slot. Codewhale does not rewrite the config, copy or delete a
798 secret, migrate neighboring paths, or make an explicit `ollama-cloud` route
799 consume the legacy slot.
800
801 ### vLLM
802
803 ```bash
804 vllm serve <model> --port 8000
805 # or: python -m vllm.entrypoints.openai.api_server --model <model> --port 8000
806 codewhale --provider vllm --model <model>
807 ```
808
809 vLLM's OpenAI-compatible server listens on port 8000 by default, matching
810 Codewhale's `VLLM_BASE_URL`.
811
812 ### SGLang
813
814 ```bash
815 python -m sglang.launch_server --model-path <model> --port 30000
816 codewhale --provider sglang --model <model>
817 ```
818
819 SGLang's default port 30000 matches Codewhale's `SGLANG_BASE_URL`.
820
821 ### Pinning a local route in config
822
823 ```toml
824 provider = "ollama" # or "vllm" / "sglang"
825
826 [providers.ollama]
827 model = "qwen3:8b" # default: a tag the local daemon lists
828 # base_url defaults to http://localhost:11434/v1
829 ```
830
831 Local models that print tool-call JSON without the wire markers: see
832 [When a Local Model Prints Tool JSON](#when-a-local-model-prints-tool-json).
833
834 ## Credential Links
835
836 Provider setup surfaces use the same typed credential metadata as onboarding,
837 `/provider`, `/links`, setup receipts, and doctor output. A missing URL is
838 intentional: local, OAuth-only, and user-defined routes show their supported
839 configuration path instead of guessing a vendor page.
840
841 | Provider ID | Credential or console link |
842 | --- | --- |
843 | `deepseek`, `deepseek-anthropic` | [DeepSeek API keys](https://platform.deepseek.com/api_keys) |
844 | `nvidia-nim` | [NVIDIA NIM API keys](https://build.nvidia.com/settings/api-keys) |
845 | `openai` | [OpenAI API keys](https://platform.openai.com/api-keys) |
846 | `atlascloud` | [Atlas Cloud API keys](https://atlascloud.ai/docs/en/api-keys) |
847 | `wanjie-ark` | [Wanjie MaaS APIKEY docs](https://docs.wanjiedata.com/maas/maas-openapi-v1.html) |
848 | `volcengine` | [Volcengine Ark API keys](https://console.volcengine.com/ark/apiKey) |
849 | `openrouter` | [OpenRouter keys](https://openrouter.ai/settings/keys) |
850 | `xiaomi-mimo` | [Xiaomi MiMo Token Plan](https://platform.xiaomimimo.com/token-plan) |
851 | `novita` | [Novita key management](https://novita.ai/en/settings/key-management) |
852 | `fireworks` | [Fireworks API keys](https://fireworks.ai/api-keys) |
853 | `siliconflow` | [SiliconFlow global API keys](https://cloud.siliconflow.com/account/ak) |
854 | `siliconflow-CN` | [SiliconFlow China API keys](https://cloud.siliconflow.cn/account/ak) |
855 | `arcee` | [Arcee API key guide](https://docs.arcee.ai/other/create-your-first-api-key) |
856 | `moonshot` | [Kimi API platform keys](https://platform.kimi.ai/console/api-keys) or [Kimi Code membership console](https://www.kimi.com/code/console) |
857 | `zai` | [Z.ai model API](https://z.ai/model-api) |
858 | `stepfun` | [StepFun Open Platform](https://platform.stepfun.ai/) |
859 | `minimax`, `minimax-anthropic` | [MiniMax interface keys](https://platform.minimax.io/user-center/basic-information/interface-key) |
860 | `huggingface` | [Hugging Face tokens](https://huggingface.co/settings/tokens) |
861 | `modelscope` | [ModelScope API Keys](https://modelscope.cn/my/settings/token) |
862 | `deepinfra` | [DeepInfra API keys](https://deepinfra.com/dash/api_keys) |
863 | `together` | [Together API keys](https://api.together.ai/settings/api-keys) |
864 | `qianfan` | [Baidu Cloud access keys](https://console.bce.baidu.com/iam/#/iam/accesslist) |
865 | `anthropic` | [Anthropic API keys](https://console.anthropic.com/settings/keys) |
866 | `openmodel` | [OpenModel console](https://console.openmodel.ai/) ([authentication guide](https://docs.openmodel.ai/en/docs/getting-started/authentication)) |
867 | `openai-codex` | Official Sign in with ChatGPT via `codewhale auth chatgpt` (eligible ChatGPT plan or credits, Codewhale-owned tokens). The `openai` API-key route has separate billing. Legacy imported Codex credentials do not authorize this route. |
868 | `sglang`, `vllm` | Local OpenAI-compatible endpoints are keyless by default; configure a key only when the server requires one. |
869 | `ollama` | Local Ollama is keyless by default; configure a key only when the local server requires one. |
870 | `ollama-cloud` | Create an [Ollama API key](https://ollama.com/settings/keys), save it with `codewhale auth set --provider ollama-cloud`, or set `OLLAMA_CLOUD_API_KEY` / `OLLAMA_API_KEY` in that precedence order. |
871 | `sakana` | [Sakana AI API keys](https://console.sakana.ai/api-keys) ([get started](https://console.sakana.ai/get-started)) |
872 | `longcat` | [Meituan LongCat platform](https://longcat.chat/platform) |
873 | `opencode-go` | [OpenCode Go](https://opencode.ai/docs/go/) |
874 | `opencode-zen` | [OpenCode Zen](https://opencode.ai/docs/zen/) |
875 | `meta` | [Meta Model API](https://developer.meta.com/ai/) |
876 | `telecomjs` | [TelecomJS TokenHub](https://aigw.telecomjs.com/) |
877 | `xai` | [xAI Console](https://console.x.ai/) for an API key, Codewhale-owned device login, or explicitly consented read-only Grok CLI credentials. |
878 | `mistral` | [Mistral Console (la Plateforme)](https://console.mistral.ai/api-keys) |
879 | `google` | [Google AI Studio](https://aistudio.google.com/apikey) — Codewhale uses the official Gemini OpenAI-compatible endpoint and never reads Google OAuth files. |
880 | `edenai` | [Eden AI API keys](https://app.edenai.run/settings/api-keys) |
881 | `zenmux` | [ZenMux API keys](https://zenmux.ai/platform/pay-as-you-go) |
882 | `csdn` | [CSDN 星图 console](https://ai.csdn.net/workbench/api-key) — choose the Coding Plan key type for the `glm_for_coding` plan route; a general key bills metered. Docs: [Coding Plan](https://ai.csdn.net/coding-plan). |
883 | `concentrate` | [Concentrate dashboard](https://concentrate.ai/) → API Keys → Create API Key (a Universal API key); docs: [API introduction](https://concentrate.ai/docs/api-reference/introduction). BYOK only — the key stays in the local secret store. |
884 | `modelstudio-token-plan`, `modelstudio-token-plan-anthropic`, `modelstudio-coding-plan`, `modelstudio-coding-plan-anthropic` | [Alibaba Cloud Model Studio (Bailian console)](https://bailian.console.aliyun.com/) — create or copy a Model Studio API key. |
885 | `codewhale` | Codewhale account API key — create one with the `models:infer` scope by running `codewhale account api-keys create --name <name> --use` from a signed-in terminal. |
886 | `custom` | Set the named provider's `base_url` and `api_key_env` or `api_key`; no canonical vendor credential page exists. |
887
888 For Kimi, the official [quickstart](https://platform.kimi.ai/docs/overview)
889 directs users to sign in, open **API Keys**, create and copy a key, and keep it
890 secret. Codewhale links straight to that console and accepts the copied key.
891 It never probes or impersonates `kimi_cli`/`kimi_code_cli`; first-class Kimi
892 OAuth remains blocked on a vendor-registered Codewhale identity.
893
894 ### Subscription sign-in accounts (ChatGPT, xAI)
895
896 Codewhale keeps one sign-in of its own per subscription provider. It is
897 separate from the browser, the ChatGPT or Grok apps, and the Codex or Grok
898 CLIs, so those can be signed in to a different account. A successful login
899 replaces the previous owned grant; there is no picker for multiple saved
900 ChatGPT accounts.
901
902 - **See which account is signed in.** `codewhale auth status --provider
903 openai-codex` (or `--provider xai`) and `codewhale auth list` show an account
904 label when the ID token contains an email. ChatGPT plan and workspace
905 details appear only when those claims are present; a workspace label uses
906 the first characters of its account ID. The label is display metadata, not
907 proof of plan entitlement. A valid sign-in may have no email label. Status
908 reads local credential state without contacting the issuer: an expired
909 access token with a stored refresh token remains structurally usable, while
910 missing or invalid storage, or an expired token without a refresh token,
911 is reported unusable. The provider picker shows the label of the sign-in
912 the route would use (for xAI this includes a consented Grok CLI import).
913 Successful login reports the account when known and whether it replaced
914 an earlier sign-in, in the TUI's selected language. No token is printed.
915 - **Replace or switch ChatGPT accounts or workspaces.** Run `/auth chatgpt`
916 inside Codewhale (or select ChatGPT in the provider picker) to switch
917 accounts live in the running session, or run `codewhale auth chatgpt` from a
918 shell (with optional `--new-account` / `--switch` aliases, or
919 `CODEWHALE_CHATGPT_NEW_ACCOUNT=1` for compatibility), then restart open
920 Codewhale sessions. Ordinary sign-in starts a fresh `dynamic_agent_client`
921 flow without pinning the previous account. If the browser holds the wrong
922 account, sign out there or open the printed URL in a private window. Only a
923 fully validated new grant replaces the active owned sign-in.
924 - **Reauthorize the current ChatGPT account.** Run
925 `codewhale auth chatgpt --reauth` from a shell to reuse the currently
926 selected account/workspace's issued client ID (`oaiapp_*`), send its
927 `login_hint`, and check that the returned account is the same. The browser
928 opens with `prompt=login`; `CODEWHALE_CHATGPT_OAUTH_NO_PROMPT=1` omits that
929 parameter if the issuer refuses it. `CODEWHALE_CHATGPT_NEW_ACCOUNT=1`
930 overrides `--reauth` to start a fresh account login.
931 - **Switch xAI accounts.** Run `/auth xai-device` inside Codewhale, or
932 `codewhale auth xai-device` from a shell and restart open sessions. The
933 device page approves with whichever account the browser holds; sign out
934 there or use a private window to approve another account. The login names
935 the account it replaced, or says it is the same account as before.
936 - **Usage limits.** ChatGPT plan requests can fail with
937 `subscription_sharing_usage_limit_exceeded` or
938 `subscription_sharing_usage_unavailable`. These errors, and subscription
939 quota errors from other providers, name the account that made the request
940 when its label is known and offer recovery guidance. Codewhale does not
941 retry these terminal errors or silently choose another billing route. An
942 xAI route set to OAuth that fell back to an API key gets no sign-in
943 guidance, since no sign-in was used.
944 - **ChatGPT credential authority.** The official ChatGPT plan route uses
945 only its selected, verified Codewhale-owned grant.
946 `OPENAI_CODEX_ACCESS_TOKEN`, `CODEX_ACCESS_TOKEN`, and consented Codex CLI
947 tokens cannot override or authorize this route.
948
949 ### External CLI credential consent
950
951 Credential files owned by another CLI are disabled by default. Without an
952 explicit grant, provider discovery, setup, routing, `auth status`, and doctor
953 do not stat, read, refresh, contact an identity provider for, or rewrite Codex,
954 Grok, Kimi, or future external credential files.
955
956 Codewhale currently supports exact-path, provider-scoped **read-only** grants
957 for the Codex CLI and Grok CLI. Codex grants remain available for legacy
958 credential inspection only; they cannot authorize the official ChatGPT plan
959 route. Use `codewhale auth chatgpt` for that route.
960
961 ```bash
962 # Legacy Codex credential inspection; does not authorize ChatGPT plan requests.
963 codex login
964 codewhale auth external-consent --provider openai-codex --mode read-only
965
966 grok login
967 codewhale auth external-consent --provider xai --mode read-only
968
969 codewhale auth status --provider openai-codex
970 codewhale auth external-revoke --provider openai-codex
971 ```
972
973 Pass `--path /absolute/path/to/auth.json` when the external CLI uses a custom
974 location. Consent persists the provider, external owner, exact absolute path,
975 and consent schema version. Later environment-variable changes do not redirect
976 that authority to a different file. Read-only grants never refresh, contact an
977 identity/discovery service, or rewrite the external file. Supported routes such
978 as xAI may use the external token after explicit selection. The official ChatGPT
979 plan route ignores imported Codex tokens and requires its own verified grant.
980 An expired external token fails with login guidance. Doctor reports structural
981 consent/config state without
982 opening credential files and is always non-mutating.
983
984 `managed` is reserved for a future provider-specific preservation adapter.
985 Codewhale rejects it before file or network I/O because no reviewed adapter can
986 yet preserve every unknown external schema field safely. Codewhale-started xAI
987 device login instead atomically activates a Codewhale-owned generation named
988 `$CODEWHALE_HOME/credentials/xai-auth-<generation>.json`, stores only that
989 validated basename in config, and revokes any Grok-file grant. Superseded
990 generations are cleaned only after the new config pointer commits.
991 Kimi remains API-key-only; external consent for Kimi is rejected.
992
993 The official DeepSeek Harness (`dsh`) is a third read-only credential owner:
994 `codewhale auth external-consent --provider deepseek --mode read-only` grants
995 exact-path read access to `DEEPSEEK_API_KEY` in `$DSH_HOME/.credentials.yaml`
996 (or `~/.dsh/.credentials.yaml`), which Codewhale never writes, refreshes, or
997 loads into the process environment. This is separate from the DSH *harness*
998 integration (`codewhale integrations dsh …`, see
999 [INTEGRATIONS_DSH.md](INTEGRATIONS_DSH.md)), which never touches credentials
1000 in either direction: it pins Codewhale's route identity into a `--patch`
1001 overlay and lets DSH resolve its own keys.
1002
1003 ## Shipped Providers
1004
1005 | Provider ID | TOML table | Auth env | Base URL env and default | Default or static models | Notes |
1006 | --- | --- | --- | --- | --- | --- |
1007 | `deepseek` | `[providers.deepseek]` | `DEEPSEEK_API_KEY` | `CODEWHALE_BASE_URL` / `DEEPSEEK_BASE_URL`; default `https://api.deepseek.com/beta` | `deepseek-flash` (shipped default; V4.1 Flash, unversioned id), `deepseek-v4-pro`, `deepseek-v4-flash`, experimental `deepseek-v4-flash-vision-exp`; compatibility aliases `deepseek-chat`, `deepseek-reasoner` | First-class default. The live Pro backend is labeled `DeepSeek-V4-Pro-0813`; the callable API ID remains `deepseek-v4-pro`. Beta URL enables strict tool mode, chat prefix completion, and FIM completion. The documented V4 routes can use provider-native web search through a separate bounded Responses request; compatible custom endpoints do not inherit that capability. Set `https://api.deepseek.com` or `/v1` explicitly to opt out of beta-only features. The shipped default `deepseek-flash` speaks the Responses API (DeepSeek's documented path for Codex-style integration, since the 2026-07-31 Flash production update); the Chat-only controls (the `thinking` toggle and strict-tool `/beta` routing) apply to Chat Completions routes, and `deepseek-v4-pro` stays on Chat Completions until its announced Responses rollout. Reasoning effort follows DeepSeek's documented requested-to-actual mapping: `minimal`/`low` land on `low`, `medium`/`xhigh` on `high`, and `max`/`ultra` on `max`; `off` disables thinking (`thinking: {"type":"disabled"}` on Chat, `reasoning.effort: "none"` on Responses). The experimental vision ID was observed in the authenticated `/models` roster on 2026-08-21 and is advertised as image-input capable on the direct Chat Completions route only. Its limits, reasoning, and tool-call flags provisionally inherit Flash, and no funded image round trip was made during this release work. DeepSeek has since retired both `deepseek-v4-flash` and the vision ID; it still accepts them, serves them with V4.1 Flash, and bills them at the `deepseek-flash` price, which Codewhale applies from 2026-09-10 04:00 UTC. The `flash`, `deepseek-v4flash`, `flash-vision`, and `deepseek-v4flashvisionexp` shorthands now select `deepseek-flash`. |
1008 | `deepseek-anthropic` | `[providers.deepseek_anthropic]` | `DEEPSEEK_API_KEY` | `DEEPSEEK_ANTHROPIC_BASE_URL`; default `https://api.deepseek.com/anthropic` | `deepseek-v4-pro`, `deepseek-v4-flash`; compatibility aliases `deepseek-chat`, `deepseek-reasoner` | Opt-in DeepSeek route for the Anthropic Messages wire protocol. Uses `/v1/messages`, `x-api-key`, and `anthropic-version: 2023-06-01`. Keep `provider = "deepseek"` for the default Chat Completions path. |
1009 | `nvidia-nim` | `[providers.nvidia_nim]` | `NVIDIA_API_KEY`, `NVIDIA_NIM_API_KEY` | `NVIDIA_NIM_BASE_URL`, `NIM_BASE_URL`, `NVIDIA_BASE_URL`; default `https://integrate.api.nvidia.com/v1` | `deepseek-ai/deepseek-v4-pro`, `deepseek-ai/deepseek-v4-flash` | Hosted DeepSeek V4 through NVIDIA NIM. `NVIDIA_NIM_MODEL` is accepted by the TUI config path. |
1010 | `openai` | `[providers.openai]` | `OPENAI_API_KEY` | `OPENAI_BASE_URL`; default `https://api.openai.com/v1` | `gpt-5.6` (default), `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna` | Generic OpenAI-compatible route whose built-in endpoint and fallback catalog are native to OpenAI. The [GPT-5.6 family](https://developers.openai.com/api/docs/models/gpt-5.6-sol) uses OpenAI's documented 1.05M context, 128K max output, and reasoning levels. The [GPT-6 family](https://developers.openai.com/api/docs/models/gpt-6-sol) (`gpt-6-sol`, `gpt-6.1-sol`, `gpt-6-luna`, `gpt-6-astra`) is not offered on this Chat Completions route because OpenAI does not support normal tool calling for them over Chat Completions. OpenAI has [deprecated](https://developers.openai.com/api/docs/deprecations) `gpt-5.3-codex` and `gpt-5.1` (replacement `gpt-6-sol`) and `gpt-5.4-nano` (replacement `gpt-6-luna`), all shutting down 2027-04-01, but those replacements need a Responses-wire OpenAI route here. Custom gateways remain free to select an explicit gateway-owned model. `OPENAI_MODEL` is accepted. |
1011 | `atlascloud` | `[providers.atlascloud]` | `ATLASCLOUD_API_KEY` | `ATLASCLOUD_BASE_URL`; default `https://api.atlascloud.ai/v1` | Default `deepseek-ai/deepseek-v4-flash`; explicit `vendor/model-id` values pass through when AtlasCloud is selected | OpenAI-compatible hosted route. `ATLASCLOUD_MODEL` is accepted by the TUI config path, the reviewed catalog selections keep DeepSeek V4 fallback rows, and provider-hinted CLI model IDs are sent to AtlasCloud exactly as requested. Use Atlas Cloud's own catalog or Coding Plan page for the current provider-owned model list and pricing. |
1012 | `wanjie-ark` | `[providers.wanjie_ark]` | `WANJIE_ARK_API_KEY`, `WANJIE_API_KEY`, `WANJIE_MAAS_API_KEY` | `WANJIE_ARK_BASE_URL`, `WANJIE_BASE_URL`, `WANJIE_MAAS_BASE_URL`; default `https://maas-openapi.wanjiedata.com/api/v1` | `deepseek-reasoner` | OpenAI-compatible hosted route. `WANJIE_ARK_MODEL`, `WANJIE_MODEL`, and `WANJIE_MAAS_MODEL` are accepted. |
1013 | `volcengine` | `[providers.volcengine]` | `VOLCENGINE_API_KEY`, `VOLCENGINE_ARK_API_KEY`, `ARK_API_KEY` | `VOLCENGINE_BASE_URL`, `VOLCENGINE_ARK_BASE_URL`, `ARK_BASE_URL`; default `https://ark.cn-beijing.volces.com/api/coding/v3` | `DeepSeek-V4-Pro`, `DeepSeek-V4-Flash` | Volcengine/Volcano Engine Ark OpenAI-compatible coding endpoint. `VOLCENGINE_MODEL` and `VOLCENGINE_ARK_MODEL` are accepted. |
1014 | `openrouter` | `[providers.openrouter]` | `OPENROUTER_API_KEY` | `OPENROUTER_BASE_URL`; default `https://openrouter.ai/api/v1` | `deepseek/deepseek-v4-pro`, `deepseek/deepseek-v4-flash`; recent large IDs include `arcee-ai/trinity-large-thinking`, `minimax/minimax-m3`, `xiaomi/mimo-v2.5-pro`, `qwen/qwen3.6-flash`, `qwen/qwen3.6-35b-a3b`, `qwen/qwen3.6-max-preview`, `qwen/qwen3.6-27b`, `qwen/qwen3.6-plus`, `google/gemma-4-31b-it`, `z-ai/glm-5.1`, `z-ai/glm-5.2`, `moonshotai/kimi-k2.7-code`, `moonshotai/kimi-k2.6` | Additive open-model routing layer. It does not replace DeepSeek; it lets users route supported model IDs through OpenRouter when they choose it. |
1015 | `orcarouter` | `[providers.orcarouter]` | `ORCAROUTER_API_KEY` | `ORCAROUTER_BASE_URL`; default `https://api.orcarouter.ai/v1` | `deepseek/deepseek-v4.1-flash-1017` (default), `deepseek/deepseek-v4-pro`, `deepseek/deepseek-v4-flash`; router alias `orcarouter/auto`; recent large IDs mirror the OpenRouter namespaced catalog | [OrcaRouter](https://www.orcarouter.ai) OpenAI-compatible aggregation gateway. Shares the namespaced `vendor/model` wire-model format and resolves model IDs and wire slugs from its own `models` block in `provider_descriptors.json` (see [Models and providers](MODELS_AND_PROVIDERS.md)). `ORCAROUTER_MODEL` is accepted. Provider aliases: `orcarouter`, `orca_router`, `orca`. |
1016 | `xiaomi-mimo` | `[providers.xiaomi_mimo]` | `XIAOMI_MIMO_TOKEN_PLAN_API_KEY`, `MIMO_TOKEN_PLAN_API_KEY`, `XIAOMI_MIMO_API_KEY`, `XIAOMI_API_KEY`, `MIMO_API_KEY` | `XIAOMI_MIMO_BASE_URL`, `MIMO_BASE_URL`, `XIAOMI_MIMO_MODE`, `MIMO_MODE`; default `https://token-plan-sgp.xiaomimimo.com/v1` | Chat: `mimo-v2.6-pro` (default), `mimo-v2.6-flash`, `mimo-v2.5-pro-ultraspeed`; speech/TTS: `mimo-v2.5-tts`, `mimo-v2.5-tts-voicedesign`, `mimo-v2.5-tts-voiceclone`, `mimo-v2-tts` | Xiaomi MiMo OpenAI-compatible chat completions route. Xiaomi [retires](https://mimo.mi.com/docs/updates/deprecate) `mimo-v2.5-pro` and `mimo-v2.5` at 2026-10-21 10:00 UTC+8; Codewhale sends `mimo-v2.6-pro` and `mimo-v2.6-flash` for those configured ids. `mimo-v2.6-pro` and `mimo-v2.6-flash` can use the documented provider-native web-search plugin; ultraspeed, speech/TTS, and custom-compatible routes do not inherit it. Token Plan keys (`tp-...`) use `api-key` auth and the token-plan endpoint by default; pay-as-you-go mode uses standard API keys (`sk-...`) and `https://api.xiaomimimo.com/v1`. It sends `max_completion_tokens` and uses MiMo's `thinking` field for reasoning control. Token Plan cost/usage is credit/quota based; Codewhale shows it as unknown until Xiaomi exposes a reliable balance API. `codewhale speech` / `tts` uses the TTS models. |
1017 | `novita` | `[providers.novita]` | `NOVITA_API_KEY` | `NOVITA_BASE_URL`; default `https://api.novita.ai/openai/v1` | `deepseek/deepseek-v4-pro`, `deepseek/deepseek-v4-flash` | OpenAI-compatible hosted route for DeepSeek model IDs. Use config or `CODEWHALE_MODEL` / `DEEPSEEK_MODEL` for model overrides. |
1018 | `fireworks` | `[providers.fireworks]` | `FIREWORKS_API_KEY` | `FIREWORKS_BASE_URL`; default `https://api.fireworks.ai/inference/v1` | `accounts/fireworks/models/deepseek-v4-pro` | OpenAI-compatible hosted route. Use config or `CODEWHALE_MODEL` / `DEEPSEEK_MODEL` for model overrides. |
1019 | `siliconflow` | `[providers.siliconflow]` | `SILICONFLOW_API_KEY` | `SILICONFLOW_BASE_URL`; default `https://api.siliconflow.com/v1` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash` | OpenAI-compatible hosted route. Official docs use the `.com` endpoint. `SILICONFLOW_MODEL` is accepted. Reasoning aliases `deepseek-reasoner` and `deepseek-r1` map to Pro; `deepseek-chat` and `deepseek-v3` map to Flash. |
1020 | `siliconflow-CN` | `[providers.siliconflow_cn]` | `SILICONFLOW_API_KEY` | `SILICONFLOW_BASE_URL`; default `https://api.siliconflow.cn/v1` | Uses the SiliconFlow model set | China regional SiliconFlow route. Falls back to `[providers.siliconflow]` for api_key / base_url / model when unset. Select it with `provider = "siliconflow-CN"` or `CODEWHALE_PROVIDER=siliconflow-CN`. |
1021 | `arcee` | `[providers.arcee]` | `ARCEE_API_KEY` | `ARCEE_BASE_URL`; default `https://api.arcee.ai/api/v1` | `trinity-large-thinking`, `trinity-large-preview` | Arcee AI direct OpenAI-compatible route, tracked as 256K-context BF16 serving. `ARCEE_MODEL` is accepted. OpenRouter's `arcee-ai/trinity-large-thinking` remains the OpenRouter namespaced model ID; direct Arcee uses the bare `trinity-large-thinking` ID. |
1022 | `moonshot` | `[providers.moonshot]` | `MOONSHOT_API_KEY`, `KIMI_API_KEY` | `MOONSHOT_BASE_URL`, `KIMI_BASE_URL`; default `https://api.moonshot.ai/v1` | Direct Moonshot: `kimi-k3`, `kimi-k2.7-code`, `kimi-k2.7-code-highspeed`, `kimi-k2.6`; Kimi Code membership: `k3`, `kimi-for-coding`, `kimi-for-coding-highspeed` at `https://api.kimi.com/coding/v1` | Moonshot/Kimi route. Exact direct `kimi-k3` routes use the documented Formula web-search tool/fiber loop; direct `kimi-k2.6` retains the built-in `$web_search` contract, and exact Kimi Code membership routes use their structured `/search` service. Adjacent paths, K2.7 direct models, and cross-product model IDs do not inherit native search. `kimi` and `kimi-k2` aliases select `kimi-k2.7-code`; `MOONSHOT_MODEL`, `KIMI_MODEL_NAME`, and `KIMI_MODEL` are accepted. Kimi thinking streams through `reasoning_content`; Codewhale keeps it in Thinking cells and replays it for thinking/tool-call continuity. For direct K3, use exact `base_url = "https://api.moonshot.ai/v1"` and `model = "kimi-k3"`; it is always-thinking and receives top-level `reasoning_effort = "low" | "high" | "max"` (`off` normalizes to `low`), uses only `max_completion_tokens`, and omits `temperature`/`top_p` per the [K3 quickstart](https://platform.kimi.ai/docs/guide/kimi-k3-quickstart). For Kimi Code K3, use a key from the [Kimi Code console](https://www.kimi.com/code/console), exact `base_url = "https://api.kimi.com/coding/v1"`, and bare `model = "k3"`; `off` becomes enabled `low`, while normal dispatched `auto` selects and sends a concrete Codewhale tier. Only an omitted reasoning setting leaves the provider default in control. That membership route defaults safely to 262,144 context tokens; the [Kimi Code model-tier table](https://www.kimi.com/code/docs/en/kimi-code/models.html) grants Allegretto and higher plans up to 1M, which those plans may express as `context_window = 1048576`. `k3[1m]` is Claude Code-only and Codewhale rejects it. `kimi-for-coding` remains the valid K2.7 membership route, and `kimi-for-coding-highspeed` is its own high-speed roster entry (262,144 context); membership ids are rejected on the direct platform endpoint, and `kimi-k3` stays rejected on the membership endpoint. Billing is decided by the endpoint the route resolves to, judged once against the two exact product endpoints: direct Moonshot (`https://api.moonshot.ai/v1` or the default) bills metered with dollar estimates, the exact Kimi Code membership endpoint bills as Kimi Code quota and never shows dollar estimates, and anything else — a gateway host, a neighboring Kimi-hosted path — reports `cost: unknown` rather than borrowing either product. An imported Kimi Code token with no `base_url` in its table still resolves to the membership endpoint, so it bills as Kimi Code quota and never accrues dollars. A completed turn, parent or sub-agent, is billed from the immutable endpoint receipt its own client was built with, never from a later config re-read: `MOONSHOT_BASE_URL`/`KIMI_BASE_URL` are merged into the *active* provider's table only, and an in-turn provider switch can move the ambient config off the route that actually ran. Legacy `auth_mode = "kimi_oauth"` fails to API-key guidance without probing Kimi CLI files. Codewhale does not impersonate `kimi_cli` or `kimi_code_cli`. **China-region keys:** contributor field evidence (@vFONGv, PR #5229, verified on Windows 10) reports that a China-region Moonshot key must be paired with `base_url = "https://api.moonshot.cn/v1"`; left on the default international host (`https://api.moonshot.ai/v1`) it fails authentication. We have no China-region key to verify this ourselves, so it is recorded as a user report rather than a tested route. Note also that editing `base_url` alone does not take effect until `codewhale auth set` is re-run for that provider. |
1023 | `google` | `[providers.google]` | `GOOGLE_API_KEY`, `GEMINI_API_KEY` | `GOOGLE_BASE_URL`, `GEMINI_BASE_URL`; default `https://generativelanguage.googleapis.com/v1beta` | `gemini-3.1-pro-preview` (default); `/model` also lists `gemini-4-hydrogen`, `gemini-4-carbon`, `gemini-4-argon`, `gemini-3.8-flash`, `gemini-3.6-flash`, `gemini-3.5-flash-lite`, `gemini-2.5-pro`, `gemini-2.5-flash` | Google Gemini on the native Generate Content API (`…/models/{model}:streamGenerateContent?alt=sse`, authenticated with `x-goog-api-key`). Google `models/` prefixes (`models/gemini-4-hydrogen`) are stripped and [deprecated](https://ai.google.dev/gemini-api/docs/changelog) `gemini-3.7-flash` (→ `gemini-3.8-flash`) and `gemini-3.5-flash` (→ `gemini-3.6-flash`) aliases are mapped by the `google` `models` rules in [Models and providers](MODELS_AND_PROVIDERS.md). `gemini-4-argon` is paid-tier only. Thinking parts stream as thinking blocks, function calls capture and replay `thoughtSignature` siblings on `functionCall` parts, and `functionResponse` parts map back by tool name. Codewhale never reads Google OAuth files; only an AI Studio API key is used. Not live-tested against the real endpoint in this environment. |
1024 | `zai` | `[providers.zai]` | `ZAI_API_KEY`, `Z_AI_API_KEY`, `ZHIPU_API_KEY`, `GLM_API_KEY` | `ZAI_BASE_URL`, `Z_AI_BASE_URL`; default `https://api.z.ai/api/coding/paas/v4`; China Coding Plan `https://open.bigmodel.cn/api/coding/paas/v4`; general APIs `https://api.z.ai/api/paas/v4` and `https://open.bigmodel.cn/api/paas/v4` | `GLM-5.3` default; `/model` also lists `GLM-5.4`, `GLM-5.3-Flash`, `GLM-5.2`, `GLM-5.1`, and `GLM-5-Turbo` | Z.AI GLM Coding Plan route. All four first-party Chat routes (both api.z.ai products and both BigModel products — Coding Plan and general platform) share one request dialect, so reasoning controls — the GLM-5.2/GLM-5.4 thinking toggle and tiered effort, and the forced-thinking GLM-5.3 rewrite that sends `off` as `enabled` + `reasoning_effort: "low"` — apply on BigModel too; neighboring paths such as `/preview` stay fail-closed. The two general API products expose structured provider-native web search (`search-prime` globally, `search_std` in China); Coding Plan and compatible custom endpoints do not inherit it. `GLM-5.3` remains the default and a first-class picker row (`model = "GLM-5.3"` or `ZAI_MODEL=GLM-5.3`); `GLM-5.4` is selectable explicitly on the Z.ai / BigModel Coding Plan (`model = "GLM-5.4"`, 1M context, 128K output, vision input, no USD price while the pay-as-you-go Model API is not yet open); `GLM-5.3-Flash` is the 1M multimodal fast sibling (`model = "GLM-5.3-Flash"`). `GLM-5.3-FlashX` is not offered because the Coding Plan endpoint this route defaults to does not serve it. Explicit model selections keep their own id. Limits and reasoning options for 5.3 are inherited from `GLM-5.2` until Z.ai publishes distinct 5.3 metadata; 5.3 and 5.4 carry no price. Flash ships the published $0.15/$0.50 list. A live call can still 429 with entitlement code 1311 on accounts that are not provisioned for 5.3. |
1025 | `stepfun` | `[providers.stepfun]` | `STEPFUN_API_KEY`, `STEP_API_KEY` | `STEPFUN_BASE_URL`, `STEP_BASE_URL`; default `https://api.stepfun.ai/v1`; Coding Plan endpoint `https://api.stepfun.ai/step_plan/v1` | `step-5` (default), `step-5-preview`, `step-3.7-flash`, `step-3.5-flash`, `step-3.5-flash-2603` | StepFun / StepFlash direct OpenAI-compatible route. `/provider` setup asks which billing route the key belongs to — pay-as-you-go or Step Plan — validates the key against the chosen endpoint, and writes the answer to `[providers.stepfun].base_url` only. A base URL that is neither recognized route is left alone and the question is skipped. You can also set `[providers.stepfun].base_url` or `STEP_BASE_URL` to the Coding Plan URL by hand. Offline accounting labels recognized routes as `stepfun-payg` or `stepfun-plan` without persisting the raw endpoint, and only the standard PAYG route receives token pricing. `STEPFUN_MODEL` and `STEP_MODEL` are accepted. |
1026 | `minimax` | `[providers.minimax]` | `MINIMAX_API_KEY` | `MINIMAX_BASE_URL`; default `https://api.minimax.io/v1`; China `https://api.minimaxi.com/v1` | `MiniMax-M3`, `MiniMax-M2.7`, `MiniMax-M2.7-highspeed`, `MiniMax-M2.5`, `MiniMax-M2.5-highspeed`, `MiniMax-M2.1`, `MiniMax-M2.1-highspeed`, `MiniMax-M2` | MiniMax direct OpenAI-compatible route. MiniMax [closes](https://platform.minimax.io/docs/guides/models-intro) `MiniMax-M2.7`, `MiniMax-M2.7-highspeed`, `MiniMax-M2.5` and `MiniMax-M2.5-highspeed` to new users on 2026-10-19 and retires them on 2026-11-18; they are no longer in the fallback picker, stay accepted for existing configs until then, and `MiniMax-M3` remains the default. Codewhale sends `reasoning_split = true` so MiniMax thinking arrives separately from answer text. Both MiniMax dialects sell pay-as-you-go and Token Plan over the same endpoints and the same key, so billing is classified from the credential *product*, never from the endpoint or from a default. `mode = "token-plan"` in `[providers.minimax]`/`[providers.minimax_anthropic]`, or a Token Plan key shaped `sk-cp…`, bills as MiniMax Token Plan quota with no dollar estimates; an explicit pay-as-you-go mode (`pay-as-you-go`/`payg`/`metered`) wins over key shape. The key's product prefix is only visible when the key is in config, bound by `api_key_env`, or exported as `MINIMAX_API_KEY` on an official endpoint — a key saved through `codewhale auth set` (secret store / OS keyring) is deliberately not read to classify billing. With no explicit mode and no visible product marker the route reports `cost: unknown` rather than assuming pay-as-you-go, so a Token Plan account is never charged invented dollars. Custom/gateway endpoints also fail closed with `cost: unknown`. Official M3 input modalities are text, image, and video; M2.7 is text-only. |
1027 | `minimax-anthropic` | `[providers.minimax_anthropic]` | `MINIMAX_API_KEY` | `MINIMAX_ANTHROPIC_BASE_URL`; default `https://api.minimax.io/anthropic`; China `https://api.minimaxi.com/anthropic` | `MiniMax-M3`, `MiniMax-M2.7` | MiniMax direct Anthropic-compatible Messages route. Keep the `/anthropic` suffix because Codewhale appends `/v1/messages`; the route uses `x-api-key`. M3 supports adaptive or disabled thinking. M2.7 always keeps thinking enabled. |
1028 | `sglang` | `[providers.sglang]` | Optional `SGLANG_API_KEY` | `SGLANG_BASE_URL`; default `http://localhost:30000/v1` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash` | Self-hosted OpenAI-compatible route. Localhost deployments commonly omit auth. `SGLANG_MODEL` is accepted. |
1029 | `vllm` | `[providers.vllm]` | Optional `VLLM_API_KEY` | `VLLM_BASE_URL`; default `http://localhost:8000/v1` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash` | Self-hosted vLLM OpenAI-compatible route. Localhost deployments commonly omit auth. `VLLM_MODEL` is accepted. |
1030 | `ollama` | `[providers.ollama]` | Local optional `OLLAMA_API_KEY` | `OLLAMA_BASE_URL`; default `http://localhost:11434/v1` | live tag from the local catalog; pre-refresh placeholder `unknown`; provider-hinted custom tags pass through | Local Ollama is keyless by default. `OLLAMA_MODEL` is accepted. The header must not paint a hosted id the local daemon did not list. |
1031 | `ollama-cloud` | `[providers.ollama_cloud]` | `OLLAMA_CLOUD_API_KEY`, then `OLLAMA_API_KEY` | `OLLAMA_CLOUD_BASE_URL`; default `https://ollama.com/v1` | `gpt-oss:120b`; arbitrary provider-owned IDs pass through | Hosted OpenAI-compatible `/v1/chat/completions` route. Save credentials under `ollama-cloud`; the exact released `ollama` + Cloud URL tuple has bounded read-only in-memory compatibility with its legacy table and secret slot. `OLLAMA_CLOUD_MODEL` is accepted. |
1032 | `huggingface` | `[providers.huggingface]` | `HUGGINGFACE_API_KEY`, `HF_TOKEN` | `HUGGINGFACE_BASE_URL`, `HF_BASE_URL`; default `https://router.huggingface.co/v1` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash` | Hugging Face Inference Providers OpenAI-compatible router route. Accepted aliases: `huggingface`, `hugging-face`, `hugging_face`, `hf`. Org-prefixed model IDs pass through. `HUGGINGFACE_MODEL` and `HF_MODEL` are accepted. Hub browsing/export are separate future features. |
1033 | `modelscope` | `[providers.modelscope]` | `MODELSCOPE_API_KEY` | `MODELSCOPE_BASE_URL`; default `https://api-inference.modelscope.cn/v1` | `Qwen/Qwen3.5-397B-A17B` (default), `Qwen/Qwen3.5-122B-A10B`, `Qwen/Qwen3.5-27B`, `Qwen/Qwen3.5-35B-A3B`, `Qwen/Qwen3.8-27B`, `Qwen/Qwen3.8-Flash-Next`, `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Pro-0813`, `deepseek-ai/DeepSeek-V4.1-Flash`, `ZhipuAI/GLM-4.7-Flash`, `ZhipuAI/GLM-5.2` | ModelScope OpenAI-compatible inference route. Org-prefixed model IDs pass through. `MODELSCOPE_MODEL` is accepted. |
1034 | `deepinfra` | `[providers.deepinfra]` | `DEEPINFRA_API_KEY`, `DEEPINFRA_TOKEN` | `DEEPINFRA_BASE_URL`; default `https://api.deepinfra.com/v1/openai` | `deepseek-ai/DeepSeek-V4-Pro` (default), `deepseek-ai/DeepSeek-V4-Flash`; also selectable: `deepseek-ai/DeepSeek-V4-Pro-0813`, `deepseek-ai/DeepSeek-V4.1-Flash-1017`, `deepseek-ai/DeepSeek-V4.1-Flash`, `deepseek-ai/DeepSeek-V4-Flash-0731` | DeepInfra OpenAI-compatible route. Drop-in replacement for OpenAI SDK. `deepseek-v4-pro` selects V4-Pro and `deepseek-flash` / `deepseek-v4-flash` select V4-Flash. DeepInfra lists V4-Pro-0813, both V4.1 Flash ids and V4-Flash-0731 at 1,048,576 context and publishes no separate output limit for them, so none is assumed; the V4.1 Flash ids take image input. |
1035 | `together` | `[providers.together]` | `TOGETHER_API_KEY` | `TOGETHER_BASE_URL`; default `https://api.together.xyz/v1` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash`, `thinkingmachines/inkling` | Together AI OpenAI-compatible route. `TOGETHER_MODEL` is accepted. Model aliases `deepseek-v4-pro` and `deepseek-v4-flash` normalize to Together's org-prefixed IDs; `inkling` and `together-inkling` normalize to Together's published lowercase Inkling wire ID. Inkling uses the exact `none`/`minimal`/`low`/`medium`/`high`/`max` reasoning vocabulary from Thinking Machines' [official model repository](https://huggingface.co/thinkingmachines/Inkling). Together's [launch post](https://www.together.ai/blog/together-ai-brings-thinking-machines-labs-new-model-inkling-on-day-0) currently says Inkling is live with 1M context, while its [model detail page](https://www.together.ai/models/inkling) says coming soon with 256K context and publishes no price. Until Together's active `/models` endpoint and the Models.dev catalog resolve that conflict, Inkling is not seeded into Codewhale's offline picker and no route-specific context or cost is inferred. |
1036 | `qianfan` | `[providers.qianfan]` | `QIANFAN_API_KEY`, `BAIDU_QIANFAN_API_KEY` | `QIANFAN_BASE_URL`, `BAIDU_QIANFAN_BASE_URL`; default `https://api.baiduqianfan.ai/v1` | `ernie-4.0-turbo-8k`; provider-scoped custom Qianfan service/model IDs pass through | Baidu Qianfan OpenAI-compatible route. Requests use Bearer auth and Chat Completions payloads. `QIANFAN_MODEL` and `BAIDU_QIANFAN_MODEL` are accepted; aliases `baidu-qianfan`, `baidu_qianfan`, and `baidu` resolve to this provider. Tool/function calling is model-scoped in Qianfan docs, so Codewhale preserves the selected wire model and leaves live capability proof to follow-up route/capability work. |
1037 | `openai-codex` | `[providers.openai_codex]` | Official Sign in with ChatGPT (`codewhale auth chatgpt` / `/provider setup openai-codex`) | Official `https://api.openai.com/v1` | Selected account catalog; configured model IDs remain explicit selections | **Experimental.** Public Responses endpoint (`/v1/responses`) with a validated `chatgpt.tokens.use.direct` grant. Dynamic OSS registration issues a client ID for the selected account/workspace; Codewhale protects and renews its own tokens. The account catalog supplies selectable models; public model lists and legacy Codex tokens do not establish plan permission. No silent billing fallback. See [Sign in with ChatGPT](#sign-in-with-chatgpt) for setup, usage limits, and preview boundaries. |
1038 | `anthropic` | `[providers.anthropic]` | `ANTHROPIC_API_KEY` | `ANTHROPIC_BASE_URL`; default `https://api.anthropic.com` | `claude-opus-5-5`, `claude-sonnet-5-5` (default), `claude-fable-5-2`, `claude-fable-5-1`, `claude-sonnet-4-6`, `claude-haiku-5-5` | Native Anthropic Messages API route (`/v1/messages`, `x-api-key` + `anthropic-version: 2023-06-01`) — not OpenAI-compatible. Prompt caching via `cache_control` breakpoints, adaptive thinking + `output_config.effort`, signed thinking blocks replayed verbatim, cache telemetry normalized per #2961. The [current models](https://platform.claude.com/docs/en/about-claude/models/overview) have 1M context and 128K output; the auto-router's cheap tier stays `claude-haiku-4-5`; `claude-haiku-5-5` is selectable and priced from the catalog because its rate rises above 100,000 prompt tokens. Codewhale softens a forced `tool_choice` to `auto` for Opus 5.5 and Sonnet 5.5, which reject it, and omits sampling parameters on the models that reject them; `/effort off` on a native route omits the `thinking` block, so the model's own default reasoning behaviour applies. The default is `claude-sonnet-5-5`. No default uses `claude-sonnet-4-5`, which [retires](https://platform.claude.com/docs/en/about-claude/model-deprecations) on 2026-11-30. `ANTHROPIC_MODEL` is accepted. |
1039 | `openmodel` | `[providers.openmodel]` | `OPENMODEL_API_KEY` | `OPENMODEL_BASE_URL`; default `https://api.openmodel.ai` | `deepseek-v4-flash`; provider-scoped custom model IDs pass through | OpenModel Anthropic-compatible Messages route. Uses `/v1/messages`, Bearer auth, and `anthropic-version: 2023-06-01`; OpenModel selects DeepSeek, DashScope, Xiaomi, Claude, and other routes by model id. `OPENMODEL_MODEL` is accepted. |
1040 | `sakana` | `[providers.sakana]` | `FUGU_API_KEY`, `SAKANA_API_KEY` | `SAKANA_BASE_URL`; default `https://api.sakana.ai/v1` | `fugu` (default), `fugu-ultra-20260615` | Sakana AI Fugu OpenAI-compatible route. Standard Chat Completions wire protocol; streaming supported. `fugu-ultra-20260615` is the heavy/reasoning variant. Env var aliases: `FUGU_API_KEY` (primary), `SAKANA_API_KEY`; provider aliases: `sakana-ai`, `sakana_ai`, `fugu`. |
1041 | `longcat` | `[providers.longcat]` | `LONGCAT_API_KEY` | `LONGCAT_BASE_URL`; default `https://api.longcat.chat/openai/v1` | `LongCat-2.0` (default) | Meituan LongCat curated model gateway. OpenAI-compatible Chat Completions wire protocol. Sign up at https://longcat.chat/platform for an API key. Provider aliases: `long-cat`, `meituan-longcat`, `meituan`. |
1042 | `opencode-go` | `[providers.opencode_go]` | `OPENCODE_GO_API_KEY` | `OPENCODE_GO_BASE_URL` | The authenticated Go catalog supplies the wire IDs. | Go publishes each model’s type, tool support and inference endpoint. Codewhale can dispatch Chat Completions, Responses and Messages models. Other types and protocols remain visible in the connection inventory. [OpenCode model list API](https://opencode.ai/docs/console/api/models/) |
1043 | `opencode-zen` | `[providers.opencode_zen]` | `OPENCODE_ZEN_API_KEY`, fallback `OPENCODE_API_KEY` | `OPENCODE_ZEN_BASE_URL`; default `https://opencode.ai/zen/v1` | `gpt-5.6` (default); paid GPT, Claude, Qwen, DeepSeek, MiniMax, GLM, Kimi, Grok, and Muse Spark IDs (`*-free` rows are restricted to OpenCode's own client) | [OpenCode Zen](https://opencode.ai/docs/zen/) model-aware gateway. `OPENCODE_ZEN_MODEL` is accepted, and official `opencode/<model-id>` selectors normalize to bare wire IDs. Each model's wire comes from the curated snapshot, then from the AI SDK package its [Models.dev](https://models.dev) row names: GPT, Grok, and Muse Spark rows use `/responses`; Claude and most Qwen rows use `/messages`; DeepSeek, MiniMax, GLM, Kimi, and `qwen3.8-max` use `/chat/completions`. Responses and Chat Completions authenticate with Bearer `Authorization`, while Anthropic Messages uses `x-api-key`; none of these routes use ChatGPT/Codex OAuth guidance or headers. OpenCode Zen's `*-free` rows are restricted by OpenCode to OpenCode's own client and fail with HTTP 429 (`FreeUsageLimitError`) from third-party clients like Codewhale; Codewhale does not impersonate OpenCode's client, so use paid OpenCode Zen rows, `opencode-go`, or another provider instead. Gemini fails closed because its model-specific Google wire protocol is not implemented; Models.dev rows marked `deprecated` and models no loaded catalog lists also fail closed. See [OpenCode Zen protocol catalog](#opencode-zen-protocol-catalog). |
1044 | `meta` | `[providers.meta]` | `META_MODEL_API_KEY`, `MODEL_API_KEY` | `META_MODEL_API_BASE_URL`, `MODEL_API_BASE_URL`; default `https://api.meta.ai/v1` | `muse-spark-1.3` (default), `muse-spark-1.2`, `muse-spark-1.3-contributor`, `muse-wonder-1.0` (preview), `muse-spark-1.2-contributor`, `muse-spark-1.1` | [Meta Model API](https://developer.meta.com/ai/resources/blog/build-with-muse-spark/) public-preview route using OpenAI-compatible Chat Completions. The default is the current same-line model in Meta's own list, `muse-spark-1.3` (1,048,576 context, tools, the `none` through `max` effort ladder). `muse-spark-1.2` stays selectable. `META_MODEL_API_MODEL` and `MODEL_API_MODEL` are accepted. Provider aliases: `meta-ai`, `meta_model_api`, `muse`, `muse-spark`. |
1045 | `telecomjs` | `[providers.telecomjs]` | `TELECOMJS_API_KEY` | `TELECOMJS_BASE_URL`; default `https://aigw.telecomjs.com/v1` | `deepseek-v4-pro` conservative fallback; authenticated `/models` rows when a key is configured | TelecomJS TokenHub OpenAI-compatible Chat Completions route. Live catalogs are isolated by provider and key fingerprint, stale rows survive transient refresh failures, and unsupported reasoning request fields are omitted. `TELECOMJS_MODEL` is accepted. Provider aliases: `telecom-js`, `telecom_js`, `telecomjs-cn`, `tokenhub`. |
1046 | `mistral` | `[providers.mistral]` | `MISTRAL_API_KEY` | `MISTRAL_BASE_URL`; default `https://api.mistral.ai/v1` | `mistral-code-latest` (default; `codestral-latest` accepted as alias), `mistral-medium-latest` (aliases: `mistral-medium-3-5`), `mistral-small-latest` (aliases: `mistral-small-2603`), `mistral-large-latest` | Mistral AI (la Plateforme) OpenAI-compatible Chat route. On the documented first-party HTTPS `/v1` hosts, Medium and Small send adjustable `reasoning_effort` (`none` or `high` only), parse Mistral's polymorphic thinking/text blocks, and replay stored thinking in that same wire shape. Deprecated native Magistral IDs remain explicit-configuration compatibility routes: they are always-reasoning and never receive the adjustable effort field. Code and Large are non-reasoning. A custom `MISTRAL_BASE_URL` keeps generic Chat semantics unless it is one of the documented first-party hosts. `MISTRAL_MODEL` is accepted. Provider aliases: `mistral-ai`, `mistralai`, `la-plateforme`. |
1047 | `edenai` | `[providers.edenai]` | `EDENAI_API_KEY` | `EDENAI_BASE_URL`; default `https://api.edenai.run/v3`; EU `https://api.eu.edenai.run/v3` | `deepseek/deepseek-v4-pro` (default); live `/models` catalog of `provider/model` ids | Eden AI OpenAI-compatible aggregation gateway. Catalog rows remain provider-scoped; generic reasoning controls are omitted because supported fields depend on the selected upstream family. `EDENAI_MODEL` is accepted. The default `deepseek/deepseek-v4-pro` is listed on the global catalog only; on the EU endpoint set `EDENAI_MODEL` (or `model`) to a row from the EU `/models` list, for example `qwen/deepseek-v4-pro`. Provider aliases: `eden-ai`, `eden_ai`. |
1048 | `zenmux` | `[providers.zenmux]` | `ZENMUX_API_KEY` | `ZENMUX_BASE_URL`; default `https://zenmux.ai/api/v1` | `deepseek/deepseek-v4.1-flash` (default); live `/models` catalog of `provider/model` ids (keyless-readable) | ZenMux OpenAI-compatible aggregation gateway (~190 models). Catalog rows remain provider-scoped; generic reasoning controls are omitted because supported fields depend on the selected upstream family. `ZENMUX_MODEL` is accepted. Provider aliases: `zen-mux`, `zen_mux`. |
1049 | `csdn` | `[providers.csdn]` | `CSDN_API_KEY` | `CSDN_BASE_URL`; default `https://ai.csdn.net/api/model/v1` | `glm_for_coding` (default; the Coding Plan's dedicated model id); other marketplace model ids pass through | CSDN 星图 (Starmap) OpenAI-compatible hosted platform. Coding Plan keys and general marketplace keys share the one endpoint, so billing follows the credential product, never the URL alone: routing `glm_for_coding` — the shipped default — or setting `mode = "coding_plan"`/`"plan"`/`"subscription"` bills as CSDN Coding Plan quota with no dollar estimates; any other model, or an explicit `pay-as-you-go`/`metered` mode, bills metered; an unrecognized mode or an endpoint off `ai.csdn.net/api/model/v1` reports `cost: unknown`. `CSDN_MODEL` is accepted. Provider aliases: `csdn-ai`, `csdn_ai`, `csdn-coding-plan`, `csdn_coding_plan`, `starmap`. |
1050 | `concentrate` | `[providers.concentrate]` | `CONCENTRATE_API_KEY` | `CONCENTRATE_BASE_URL`; default `https://api.concentrate.ai/v1` | `deepseek-v4-pro` (default; a plain catalog id lets the gateway pick the upstream provider); `provider/model` ids such as `openai/gpt-5.6-sol` pin one upstream; `concentrate/auto` is the gateway's own router; unauthenticated live `/v1/models` catalog | Concentrate OpenAI Responses-compatible gateway (`POST /v1/responses`, bearer Universal API key). Opt-in and BYOK only: your key, your Concentrate bill, zero Codewhale fee, no managed default. Requests carry only documented fields (the system prompt rides as a `system` input item). Contract: [API introduction](https://concentrate.ai/docs/api-reference/introduction), [request parameters](https://concentrate.ai/docs/api-reference/endpoint/request-parameters), [streaming](https://concentrate.ai/docs/api-reference/endpoint/streaming), [errors](https://concentrate.ai/docs/api-reference/endpoint/errors). See [Concentrate Notes](#concentrate-notes). |
1051 | `codewhale` | `[providers.codewhale]` | `CODEWHALE_API_KEY` | `CODEWHALE_API_BASE`; default `https://api.codewhale.net/v1` | `deepseek/deepseek-v4-pro` (default), `anthropic/claude-sonnet-5`, `openai/gpt-5.6` are offline bootstrap rows only; the authenticated `GET /v1/models` listing of the account's connected providers is the catalog authority | Codewhale API: account-backed model access over the provider keys the customer connected to their Codewhale account. One `cwc_key_…` account API key with the `models:infer` scope authenticates every model. Model ids are `provider/model` exactly as the account catalog returns them, and each row states its protocol (`chat-completions` → `/v1/chat/completions`, `anthropic-messages` → `/v1/messages`, `responses` → `/v1/responses`); every protocol uses `Authorization: Bearer`, never `x-api-key`. `CODEWHALE_API_BASE` must be HTTPS except on loopback. Connect provider keys with `codewhale account keys set <provider>`. Provider aliases: `codewhale-api`, `cw-api`, `codewhale-cloud`. |
1052 | `xai` | `[providers.xai]` | `XAI_API_KEY`, Codewhale-owned device OAuth, or explicit read-only Grok CLI consent | `XAI_BASE_URL`; default `https://api.x.ai/v1` | `grok-4.7` (default), `grok-4.6`, `grok-4.5`, `grok-4.3`, `grok-build`, `grok-composer-2.5-fast`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning` | xAI/Grok OpenAI-compatible Chat Completions route. The default is the current same-line model in xAI's own list, [Grok 4.7](https://docs.x.ai/docs/models/grok-4.7): 500K context, text/image input, function calls, structured output, the `low`/`medium`/`high`/`xhigh` ladder, and $2.00 / $0.50 cached / $6.00. Grok 4.6 keeps the same window and rates and is the model with documented server-side web search; Codewhale does not claim web search for 4.7. Grok reasoning cannot be disabled ([reasoning guide](https://docs.x.ai/docs/guides/reasoning)). Its standard rates double when the prompt reaches 200K tokens; the same 2x long-context rule applies to `grok-4.5` (500K context, $2.00 / $0.30 cached / $6.00) and `grok-4.3` (1M context, $1.25 / $0.20 cached / $2.50) per their [model pages](https://docs.x.ai/docs/models/grok-4.5). There is no documented `latest`/`fast` alias and no published numeric output limit. **API-key** (default): Bearer token from console.x.ai via `XAI_API_KEY` / keyring / `api_key`. **OAuth**: `codewhale auth xai-device` uses SSH-friendly device login and Codewhale-owned storage, which may refresh itself. Existing Grok CLI credentials require `codewhale auth external-consent --provider xai --mode read-only`; the granted external file is never refreshed or rewritten. OAuth may return HTTP 403 on some SuperGrok tiers — keep API-key as the reliable fallback. `XAI_MODEL` is accepted. Provider aliases: `x-ai`, `x_ai`, `grok`. |
1053 | `modelstudio-token-plan` | `[providers.modelstudio_token_plan]` | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` | `MODELSTUDIO_TOKEN_PLAN_BASE_URL`; default `https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1` | `qwen3.8-max` (default), `qwen4-max-preview`, `qwen3.7-plus`, `qwen3.7-max`, `qwen3.6-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-0731`, `glm-5.2` | Alibaba Cloud Model Studio Token Plan OpenAI-compatible Chat Completions route. Token Plan Personal and Team share this endpoint. `qwen3.8-max`, `qwen3.7-plus`, and `qwen3.7-max` can use provider-native web search through the Token Plan Responses Harness; the Coding Plan and Anthropic routes do not inherit that capability. Alibaba retired `qwen3.8-max-preview` on 2026-08-05 and routes it to `qwen3.8-max`, so it is no longer listed. All listed models except `qwen4-max-preview` are reasoning-capable text/coding models. Alibaba's table calls `qwen4-max-preview` a reasoning model with visual understanding but publishes no context window, output limit, tool calling or thinking control, so Codewhale records image input only and sends it no thinking switch on either dialect. DeepSeek and GLM entries are provider-scoped and do not collide with first-party routes. `MODELSTUDIO_TOKEN_PLAN_MODEL` is accepted. Provider aliases: `modelstudio-token-plan`, `alibaba-token-plan`, `dashscope-token-plan`. |
1054 | `modelstudio-token-plan-anthropic` | `[providers.modelstudio_token_plan_anthropic]` | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` | default `https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic` | Same model catalog as `modelstudio-token-plan` | Token Plan Anthropic-compatible Messages route (`/apps/anthropic`). Same API key as the OpenAI dialect. Provider aliases: `modelstudio-token-plan-anthropic`, `alibaba-token-plan-anthropic`. |
1055 | `modelstudio-coding-plan` | `[providers.modelstudio_coding_plan]` | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` | `MODELSTUDIO_CODING_PLAN_BASE_URL`; default `https://coding-intl.dashscope.aliyuncs.com/v1` | `qwen3.8-max` (default); same ids as Token Plan except `qwen4-max-preview`, which is Token Plan only | Alibaba Cloud Model Studio Coding Plan OpenAI-compatible Chat Completions route. `MODELSTUDIO_CODING_PLAN_MODEL` is accepted. Provider aliases: `modelstudio-coding-plan`, `alibaba-coding-plan`, `dashscope-coding-plan`. |
1056 | `modelstudio-coding-plan-anthropic` | `[providers.modelstudio_coding_plan_anthropic]` | `MODELSTUDIO_API_KEY`, `DASHSCOPE_API_KEY` | default `https://coding-intl.dashscope.aliyuncs.com/apps/anthropic` | Same model catalog as `modelstudio-coding-plan` | Coding Plan Anthropic-compatible Messages route (`/apps/anthropic`). Provider aliases: `modelstudio-coding-plan-anthropic`, `alibaba-coding-plan-anthropic`. |
1057
1058 StepFun's coding models are available through both its standard API and
1059 [Step Plan](https://platform.stepfun.ai/docs/en/step-plan/integrations/reasoning-api).
1060 Choose the billing route in `/provider`, then the model in `/model`; Step 5
1061 (`step-5`) is the default, while `step-5-preview` and `step-3.7-flash` remain
1062 selectable and existing explicit selections stay unchanged. [Step 5 Preview](https://platform.stepfun.ai/docs/en/guides/models/step-5-preview)
1063 has a 1M context window. Step 5 and Step 3.7 expose low/medium/high reasoning;
1064 Step 3.5 Flash 2603 exposes low/high; base Step 3.5 uses provider-default reasoning.
1065 [Published API prices](https://platform.stepfun.ai/docs/en/guides/pricing/details)
1066 apply only to verified PAYG routes. Step Plan displays subscription allowance.
1067 Speech, music and image-generation models use separate interfaces and are not
1068 presented as coding models. Provider video capability metadata does not imply
1069 that every Codewhale client can attach video.
1070
1071
1072 ### OpenCode Zen protocol catalog
1073
1074 Zen Responses and Chat Completions requests authenticate with Bearer
1075 `Authorization`; Zen Anthropic Messages requests use `x-api-key`. None of these
1076 routes add ChatGPT/Codex OAuth headers.
1077
1078 Each Zen model's wire comes from two sources, and neither is guessed from a
1079 model-id family (`qwen3.8-flash` is Messages while `qwen3.8-max` is Chat):
1080
1081 1. **The curated snapshot** compiled into Codewhale, verified against the
1082 [official endpoint table](https://opencode.ai/docs/zen/) and the `opencode`
1083 provider in [Models.dev](https://models.dev). It is the offline floor, and
1084 it wins when a catalog row names a different wire for the same id.
1085 2. **The Models.dev catalog.** Its `opencode` provider is Zen's published
1086 catalog: each model row names the AI SDK package OpenCode itself uses, which
1087 Codewhale maps exactly — `@ai-sdk/openai` to Responses, `@ai-sdk/anthropic`
1088 to Anthropic Messages, and `@ai-sdk/openai-compatible` (the provider
1089 default) to Chat Completions. A Zen model released after this build routes
1090 once the catalog lists it, without a Codewhale release. The interactive TUI
1091 and `codewhale exec` both load the persisted catalog; refresh it with
1092 `codewhale models --update`.
1093
1094 The curated snapshot:
1095
1096 - Responses: `gpt-6-astra`, `gpt-6-sol`, `gpt-6-luna`, `gpt-5.6-sol`,
1097 `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5`, `gpt-5.5-pro`, `gpt-5.4`,
1098 `gpt-5.4-pro`, `gpt-5.4-mini`, `gpt-5.4-nano`, `gpt-5.3-codex`,
1099 `gpt-5.3-codex-spark`, `gpt-5.2`, `gpt-5.2-codex`, `gpt-5.1`,
1100 `gpt-5.1-codex`, `gpt-5.1-codex-max`, `gpt-5.1-codex-mini`, `gpt-5`,
1101 `gpt-5-codex`, `gpt-5-nano`, `grok-4.7`, `grok-4.6`, `grok-4.5`,
1102 `grok-build-0.1`, `muse-spark-1.3`, `muse-spark-1.2`,
1103 `muse-spark-1.2-contributor`.
1104 - Anthropic Messages: `claude-fable-5-2`, `claude-fable-5-1`, `claude-fable-5`,
1105 `claude-opus-5-5`, `claude-opus-5`, `claude-opus-4-8`, `claude-opus-4-7`,
1106 `claude-opus-4-6`, `claude-opus-4-5`, `claude-sonnet-5-5`,
1107 `claude-sonnet-5`, `claude-sonnet-4-6`, `claude-sonnet-4-5`,
1108 `claude-sonnet-4`, `claude-haiku-4-5`, `qwen3.8-flash`, `qwen3.7-max`,
1109 `qwen3.7-plus`, `qwen3.6-plus`, `qwen3.5-plus`.
1110 - Chat Completions: `deepseek-v4.1-flash`, `deepseek-v4-pro`,
1111 `deepseek-v4-flash`, `deepseek-v4-flash-vision-exp`, `minimax-m3`,
1112 `minimax-m2.7`, `minimax-m2.5`, `glm-5.3-flash`, `glm-5.3`, `glm-5.2`,
1113 `glm-5.1`, `glm-5`, `kimi-k3`, `kimi-k2.7-code`, `kimi-k2.6`, `kimi-k2.5`,
1114 `qwen3.8-max`, `big-pickle`.
1115
1116 OpenCode Zen's `*-free` rows (for example `deepseek-v4-flash-free`,
1117 `space-bunny-free`, `mimo-v2.6-flash-free`, and
1118 `muse-spark-1.3-contributor-free`) are restricted by OpenCode to OpenCode's own
1119 client and fail with HTTP 429 (`FreeUsageLimitError`) from third-party clients
1120 like Codewhale. Codewhale does not spoof OpenCode's client prompt, session ID,
1121 or TLS cipher list; use paid OpenCode Zen rows, configure `opencode-go`, or
1122 choose another provider instead.
1123
1124 These fail closed locally, with the reason in the error, instead of reaching
1125 Zen: Gemini (`@ai-sdk/google`, Google's model-specific protocol, which Codewhale
1126 does not speak); a catalog row naming any other package; a catalog row Models.dev
1127 marks `deprecated`; and a model neither source lists. A miss never falls back to
1128 another Zen wire shape, including when a custom Zen base URL is configured.
1129
1130 ### Concentrate Notes
1131
1132 Concentrate (`concentrate`) is an OpenAI **Responses**-compatible gateway:
1133 `POST https://api.concentrate.ai/v1/responses` with `Authorization: Bearer
1134 <Universal API key>`. It is opt-in and **BYOK only**.
1135
1136 - **Model ids pass through.** A plain catalog id (`gpt-5.6-sol`,
1137 `deepseek-v4-pro`) lets the gateway choose the upstream provider;
1138 `provider/model` (`openai/gpt-5.6-sol`) pins the upstream provider inside the
1139 gateway; `concentrate/auto` sends the gateway's own `auto` router. Codewhale's
1140 bare `--model auto` remains the resolver sentinel (provider default), which is
1141 why the gateway router has its own explicit spelling. Once streaming begins
1142 the gateway commits to one provider ([auto routing](https://concentrate.ai/docs/api-reference/endpoint/auto-routing)).
1143 - **Wire.** Fixed Responses dialect. The request carries only documented
1144 fields — `model`, `input`, `stream`, `max_output_tokens`, `tools`,
1145 `tool_choice`, `parallel_tool_calls`, `reasoning.effort` — and the system
1146 prompt travels as a leading `system` input item because `instructions` is
1147 not in the gateway's [parameter reference](https://concentrate.ai/docs/api-reference/endpoint/request-parameters).
1148 Streaming follows the typed `response.*` SSE events and ends on
1149 `response.completed` without a `[DONE]` sentinel ([streaming](https://concentrate.ai/docs/api-reference/endpoint/streaming)).
1150 - **Errors.** `{ "error", "message", "model"?, "retry_after"? }` with 400
1151 (bad request / unknown model), 401 (invalid key), 402 (insufficient
1152 credits), 424 (upstream provider unavailable), 429 (rate limit) —
1153 surfaced verbatim and classified by message ([errors](https://concentrate.ai/docs/api-reference/endpoint/errors)).
1154 - **Catalog.** `GET /v1/models` needs no key
1155 ([list models](https://concentrate.ai/docs/api-reference/endpoint/list-models)); the live rows
1156 are provider-scoped and unclaimed (no pricing or capability claims).
1157 - **Commercial boundary.** Concentrate's [Terms of Service](https://concentrate.ai/legal/terms-of-service)
1158 forbid reselling, white-labeling, or providing the service on a
1159 service-bureau basis without written consent, and its
1160 [Acceptable Use Policy](https://concentrate.ai/legal/acceptable-use-policy)
1161 forbids sharing or sublicensing keys. Codewhale therefore ships **no**
1162 Codewhale-owned Concentrate key, no stored customer key, no default or
1163 managed routing, and no markup — activation of any hosted lane is gated on
1164 written consent, terms, and billing approval (tracked in the Codewhale ops
1165 evidence checklist `concentrate-gateway-20260829/CHECKLIST.md`). Public
1166 pricing states "No platform markup on tokens".
1167
1168 ### Hugging Face Provider vs MCP vs Hub
1169
1170 Codewhale's `huggingface` provider ID is only the OpenAI-compatible chat
1171 inference route through Hugging Face Inference Providers. It is selected with
1172 `/provider huggingface`, `CODEWHALE_PROVIDER=huggingface`, or
1173 `provider = "huggingface"`.
1174
1175 Hugging Face MCP is a separate external-tool route. Configure it through the
1176 MCP config described in `docs/MCP.md`, preferably using the settings-generated
1177 snippet from <https://huggingface.co/settings/mcp>. In the TUI, `/hf mcp status`
1178 checks whether the Hugging Face MCP server appears in the resolved MCP config,
1179 `/hf mcp setup` prints the settings workflow and a placeholder-only shape, and
1180 `/hf concepts` explains the provider/MCP/Hub distinction.
1181
1182 Hub publishing or repository management remains explicit user action through
1183 Hub-native tooling such as `huggingface_hub` or git. The `/hf` helper does not
1184 upload to Hugging Face and does not perform direct Hugging Face Hub HTTP search.
1185
1186 ### Xiaomi MiMo Notes
1187
1188 `xiaomi-mimo` defaults to `mimo-v2.6-pro` for long-context reasoning and coding
1189 work. The chat picker also exposes `mimo-v2.6-flash` (the replacement for the
1190 retired Omni model `mimo-v2.5`) and `mimo-v2.5-pro-ultraspeed`. Xiaomi MiMo TTS is available through
1191 `codewhale --provider xiaomi-mimo speech "text" --model tts` (or the `tts`
1192 alias). In Work and Operate, the provider-specific `speech` tool is
1193 available through deferred discovery when the Xiaomi MiMo route is configured.
1194
1195 `/provider xiaomi-mimo ultraspeed` and `/provider xiaomi-mimo pro-ultraspeed`
1196 both select `mimo-v2.5-pro-ultraspeed`. Speech aliases such as `tts`,
1197 `voice-design`, and `voice-clone` are separate from normal chat defaults.
1198
1199 Token Plan keys default to the Singapore endpoint
1200 `https://token-plan-sgp.xiaomimimo.com/v1`. If your MiMo account is provisioned
1201 for the China region, set `base_url = "https://token-plan-cn.xiaomimimo.com/v1"`
1202 explicitly in `[providers.xiaomi_mimo]` or set `mode = "token-plan-cn"`. Europe
1203 Token Plan accounts can set
1204 `base_url = "https://token-plan-ams.xiaomimimo.com/v1"` or use
1205 `mode = "token-plan-ams"`; `mode = "pay-as-you-go"`
1206 selects the standard API endpoint and standard MiMo key family. Xiaomi Token
1207 Plan docs and console expose credit/quota semantics, but Codewhale does not
1208 currently have a documented balance endpoint to poll, so cost display remains
1209 unknown rather than reusing token-price estimates from another provider.
1210
1211 Voice-design and voice-clone shorthands map to `mimo-v2.5-tts-voicedesign` and
1212 `mimo-v2.5-tts-voiceclone`. Xiaomi's current
1213 [image-understanding guide](https://platform.xiaomimimo.com/docs/en-US/usage-guide/multimodal-understanding/image-understanding)
1214 includes `mimo-v2.5` for image input. Codewhale exposes image analysis through the
1215 separate `[vision_model]` / `image_analyze` path; set that model to
1216 `mimo-v2.5` when using MiMo for vision.
1217
1218 ### OpenRouter-Compatible Base URLs
1219
1220 OpenRouter-compatible gateways should usually stay on the `openrouter`
1221 provider with a provider-scoped `base_url` override instead of moving through
1222 the generic `openai` route. That keeps OpenRouter-style reasoning, streaming,
1223 cache usage, and namespaced wire model parsing attached to the selected route:
1224
1225 ```toml
1226 provider = "openrouter"
1227
1228 [providers.openrouter]
1229 api_key = "sk-..."
1230 base_url = "https://openrouter-compatible.example/v1"
1231 model = "deepseek/deepseek-v4-pro"
1232 ```
1233
1234 Codewhale preserves the `deepseek/` wire-model prefix under the OpenRouter
1235 provider scope; it does not infer a switch to the direct DeepSeek provider from
1236 that model string. Cache fields such as `prompt_cache_hit_tokens`,
1237 `prompt_cache_miss_tokens`, and `prompt_tokens_details.cached_tokens` are
1238 parsed when the upstream gateway sends them. If a key/account type omits those
1239 fields, Codewhale treats them as absent for that response rather than as a
1240 different provider route.
1241
1242 OrcaRouter (`https://api.orcarouter.ai/v1`) is a dedicated named route
1243 ([OrcaRouter](https://www.orcarouter.ai)) that speaks the same OpenAI
1244 Chat Completions wire protocol and serves the same namespaced
1245 `vendor/model` catalog. It does not need an OpenRouter-compatible
1246 `base_url` override: select `provider = "orcarouter"` and its namespaced
1247 wire models (for example `deepseek/deepseek-v4-pro` or its own
1248 `orcarouter/auto` router) pass through verbatim, exactly as they do on the
1249 OpenRouter provider scope. A new OrcaRouter session with no saved wire model
1250 and no catalog row marked as the provider default starts on
1251 `deepseek/deepseek-v4.1-flash-1017`.
1252
1253 #### OrcaRouter credentials: API key or OAuth 2.0 + PKCE
1254
1255 OrcaRouter accepts two credential sources, and both write the same durable
1256 `sk-orca-…` key to the same `orcarouter` secret-store slot with
1257 `auth_mode = "api_key"`:
1258
1259 - **API key** — `codewhale auth set --provider orcarouter`, `/provider`, or
1260 `ORCAROUTER_API_KEY`. Use this when you already have a key.
1261 - **Connect with OrcaRouter** — `codewhale auth orcarouter` (CLI) or
1262 `/auth orcarouter` (in-session). This runs an OAuth 2.0 authorization-code
1263 flow with PKCE (S256) on a loopback redirect. The browser is sent to
1264 `GET https://www.orcarouter.ai/auth` with `callback_url`, `code_challenge`,
1265 `code_challenge_method=S256`, `state`, `app_name`, `scope`, and `ref`
1266 (Codewhale's public OrcaRouter identifier; `app_id` is added once
1267 OrcaRouter issues one); the code is exchanged at
1268 `POST https://www.orcarouter.ai/api/v1/auth/keys` for a durable API key.
1269 There is no client secret; state is compared in constant time before the
1270 code is used.
1271
1272 Authentication and inference use different origins: the consent and exchange
1273 live on `https://www.orcarouter.ai`; models and chat live on
1274 `https://api.orcarouter.ai/v1`. Neither is derived from the other, and
1275 `/v1/auth/keys` on the API origin is not the exchange route. The inference
1276 origin can be overridden with `ORCA_API_BASE_URL`, `ORCA_BASE_URL` or
1277 `ORCAROUTER_BASE_URL`; remote origins must be HTTPS, and plain HTTP is
1278 accepted only on loopback. The sign-in origin stays
1279 `https://www.orcarouter.ai`: `ORCA_AUTH_BASE_URL` and
1280 `ORCAROUTER_AUTH_BASE_URL` move it only to a plain-HTTP loopback address for
1281 local test fixtures, any other value is ignored, and `ORCA_BASE_URL` never
1282 moves it.
1283
1284 A PKCE-issued key is a durable API key, **not** a refresh token: Codewhale
1285 stores it, reuses it across restarts, and never sends a refresh grant. Revoke
1286 the key on the OrcaRouter console (`/auth orcarouter-revoke` clears the local
1287 copy) and sign in again to get a new one. A 401 from the relay marks that
1288 credential generation as needing re-authentication rather than silently
1289 retrying.
1290
1291 The chat model list is discovered live from `GET https://api.orcarouter.ai/v1/models`
1292 with the configured key; its listed prices, including long-prompt price
1293 tiers, become the route's price estimates. This route speaks Chat Completions,
1294 so the chat selector keeps only rows whose `supported_endpoint_types` include
1295 `openai`, leaves out rows offered only on another dialect (such as
1296 Gemini-only image models), and drops image-generation,
1297 video, and rerank rows instead of guessing from a model name. A row that
1298 states `architecture.input_modalities` with `image` is image-input capable;
1299 rows that state no architecture are treated as unknown, not as text-only.
1300
1301 The desktop app connects OrcaRouter without a terminal through the Runtime
1302 API's `POST /v1/providers/orcarouter/connect`, which runs this same flow in the
1303 local Engine: the app opens the returned consent link in the system browser,
1304 and the Engine waits on its loopback callback, exchanges the code and stores
1305 the key exactly as `codewhale auth orcarouter` does. See
1306 [RUNTIME_API.md](RUNTIME_API.md).
1307
1308 ### Recent OpenRouter Large Models
1309
1310 OpenRouter completions and static registry rows include the April 2026 onward
1311 large models verified through OpenRouter's model metadata:
1312 `arcee-ai/trinity-large-thinking`, `qwen/qwen3.6-flash`,
1313 `qwen/qwen3.6-35b-a3b`, `qwen/qwen3.6-max-preview`, `qwen/qwen3.6-27b`,
1314 `qwen/qwen3.6-plus`, `minimax/minimax-m3`, `xiaomi/mimo-v2.5-pro`,
1315 `xiaomi/mimo-v2.5`, `moonshotai/kimi-k2.7-code`, `moonshotai/kimi-k2.6`,
1316 `z-ai/glm-5.1`, `z-ai/glm-5.2`, `z-ai/glm-5-turbo`, `tencent/hy3-preview`,
1317 `google/gemma-4-31b-it`, `google/gemma-4-26b-a4b-it`, and
1318 `nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free`.
1319 `minimax/minimax-m3` was added from OpenRouter's May 31, 2026 listing as a 1M
1320 context multimodal model for coding, tool use, and long-horizon agentic work.
1321 `GLM-5.3` is now the default direct Z.AI Coding Plan model; `GLM-5.2` /
1322 `z-ai/glm-5.2` remain available (explicit selections keep their own id),
1323 `GLM-5.1` / `z-ai/glm-5.1` remain available as the smaller model,
1324 `GLM-5.3-Flash` / `z-ai/glm-5.3-flash` is the faster/explore sibling of
1325 `GLM-5.3`, and `GLM-5-Turbo` / `z-ai/glm-5-turbo` remains the faster sibling
1326 of `GLM-5.2`.
1327 `GLM-5.3` / `z-ai/glm-5.3` and `GLM-5.3-Flash` / `z-ai/glm-5.3-flash` are
1328 first-class picker ids on the Z.ai and OpenRouter routes (`/model` after
1329 `/provider zai`, or `model = "GLM-5.3-Flash"`).
1330 Limits and reasoning options for 5.3 are inherited from
1331 `GLM-5.2` until Z.ai publishes distinct 5.3 metadata, and 5.3 carries no
1332 price. Flash ships the published $0.15/$0.50 list. A live call can still
1333 429 with entitlement code 1311 on accounts that are not provisioned for 5.3.
1334
1335 ## Static Model Registry
1336
1337 This table records reviewed catalog selection rows checked by
1338 `scripts/check-provider-registry.py`. Model-ID resolution (`ids` policy,
1339 stripped prefixes, aliases, vendor `wire_slugs`, and custom `base_url`
1340 pass-through) is owned by `codewhale_config::route::resolve_model` and
1341 documented in [Models and providers](MODELS_AND_PROVIDERS.md); current
1342 `codewhale model resolve`, `codewhale model list`, the picker, and the Runtime
1343 API all read that single resolver and the shared provider lake. `models
1344 --update` refreshes the catalog cache; later routes see new metadata, while
1345 dispatched requests retain their admitted limits and price receipt.
1346
1347 Public discovery can contain metadata-only models; an authenticated provider
1348 roster establishes account availability (`account_access: unverified` means
1349 public or bundled facts have not proven account access). A same-named custom
1350 endpoint keeps its own declared limits and prices.
1351
1352 `codewhale model resolve MODEL --provider PROVIDER` reports the exact wire ID,
1353 canonical ID when declared, limits and implemented capabilities. Runtime
1354 `GET /v1/providers/PROVIDER/models` adds source, fetch/expiry metadata, published
1355 price structure, reasoning options, configured effective limits and the price
1356 status. Context responses distinguish an active engine window from the static
1357 route's resolution source, including any fallback. See
1358 [Catalog refresh](CATALOG_REFRESH.md) for freshness and estimate boundaries.
1359
1360 | Provider | Static registry entries | Tool calls | Registry reasoning flag |
1361 | --- | --- | --- | --- |
1362 | `deepseek` | `deepseek-v4-pro`, `deepseek-v4-flash`, `deepseek-v4-flash-vision-exp` | yes | yes |
1363 | `nvidia-nim` | `deepseek-ai/deepseek-v4-pro`, `deepseek-ai/deepseek-v4-flash` | yes | yes |
1364 | `openai` | `deepseek-v4-pro`, `deepseek-v4-flash`, `gpt-5.6`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna` | yes | yes |
1365 | `atlascloud` | `deepseek-ai/deepseek-v4-flash`, `deepseek-ai/deepseek-v4-pro` | yes | yes |
1366 | `wanjie-ark` | `deepseek-reasoner` | yes | yes |
1367 | `volcengine` | `DeepSeek-V4-Pro`, `DeepSeek-V4-Flash` | yes | yes |
1368 | `openrouter` | `deepseek/deepseek-v4-pro`, `deepseek/deepseek-v4-flash`, `arcee-ai/trinity-large-thinking`, `minimax/minimax-m3`, `minimax/minimax-m2.7`, `xiaomi/mimo-v2.5-pro`, `xiaomi/mimo-v2.5`, `qwen/qwen3.6-flash`, `qwen/qwen3.6-35b-a3b`, `qwen/qwen3.6-max-preview`, `qwen/qwen3.6-27b`, `qwen/qwen3.6-plus`, `qwen/qwen3.7-max`, `moonshotai/kimi-k2.7-code`, `moonshotai/kimi-k2.6`, `z-ai/glm-5.1`, `z-ai/glm-5.2`, `z-ai/glm-5.3`, `z-ai/glm-5.3-flash`, `z-ai/glm-5-turbo`, `tencent/hy3-preview`, `google/gemma-4-31b-it`, `google/gemma-4-26b-a4b-it`, `nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free`, `nvidia/nemotron-3-ultra-550b-a55b` | yes | yes |
1369 | `orcarouter` | `deepseek/deepseek-v4.1-flash-1017` (default), `deepseek/deepseek-v4-pro`, `deepseek/deepseek-v4-flash`, `orcarouter/auto` | yes | yes |
1370 | `xiaomi-mimo` | `mimo-v2.6-pro`, `mimo-v2.6-flash`, `mimo-v2.5-pro-ultraspeed`; speech/TTS IDs are selected through `codewhale speech` / `tts` | yes | yes for chat models; no for speech/TTS models |
1371 | `novita` | `deepseek/deepseek-v4-pro`, `deepseek/deepseek-v4-flash` | yes | yes |
1372 | `fireworks` | `accounts/fireworks/models/deepseek-v4-pro` | yes | yes |
1373 | `siliconflow` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash` | yes | yes |
1374 | `arcee` | `trinity-large-thinking`, `trinity-large-preview`; provider-hinted custom model IDs pass through | yes | yes for `trinity-large-thinking`; no for `trinity-large-preview` |
1375 | `moonshot` | `kimi-k2.7-code`, `kimi-k2.6` | yes | yes |
1376 | `zai` | `GLM-5.3` (default), `GLM-5.4`, `GLM-5.3-Flash`, `GLM-5.2`, `GLM-5.1`, `GLM-5-Turbo`; provider-hinted custom model IDs pass through | yes | yes |
1377 | `stepfun` | `step-5` (default), `step-5-preview`, `step-3.7-flash`, `step-3.5-flash`, `step-3.5-flash-2603` | yes | yes |
1378 | `minimax` | `MiniMax-M3`, `MiniMax-M2.1`, `MiniMax-M2.1-highspeed`, `MiniMax-M2`; `MiniMax-M2.7`, `MiniMax-M2.7-highspeed`, `MiniMax-M2.5` and `MiniMax-M2.5-highspeed` stay accepted until their 2026-11-18 retirement | yes | yes |
1379 | `minimax-anthropic` | `MiniMax-M3`, `MiniMax-M2.7` | yes | yes |
1380 | `sglang` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash` | yes | yes |
1381 | `vllm` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash` | yes | yes |
1382 | `ollama` | live local tag; custom tags pass through when provider hint is `ollama` | yes | no |
1383 | `ollama-cloud` | `gpt-oss:120b`; arbitrary provider-owned model IDs pass through | yes | yes |
1384 | `huggingface` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash` | yes | no |
1385 | `modelscope` | `Qwen/Qwen3.5-397B-A17B`, `Qwen/Qwen3.5-122B-A10B`, `Qwen/Qwen3.5-27B`, `Qwen/Qwen3.5-35B-A3B`, `Qwen/Qwen3.8-27B`, `Qwen/Qwen3.8-Flash-Next`, `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Pro-0813`, `deepseek-ai/DeepSeek-V4.1-Flash`, `ZhipuAI/GLM-4.7-Flash`, `ZhipuAI/GLM-5.2` | yes | no |
1386 | `deepinfra` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash`, `deepseek-ai/DeepSeek-V4-Pro-0813`, `deepseek-ai/DeepSeek-V4.1-Flash-1017`, `deepseek-ai/DeepSeek-V4.1-Flash`, `deepseek-ai/DeepSeek-V4-Flash-0731` | yes | yes |
1387 | `together` | `deepseek-ai/DeepSeek-V4-Pro`, `deepseek-ai/DeepSeek-V4-Flash`, `thinkingmachines/inkling` | yes | yes |
1388 | `openai-codex` | the ChatGPT plan roster the account actually serves (`gpt-6.1-sol`, `gpt-6-astra`, `gpt-6-sol`, `gpt-6-luna`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna` observed 2026-10-23); `gpt-6.1-sol` is the offline default | yes | yes |
1389 | `anthropic` | `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-haiku-5-5`, `claude-fable-5-2`, `claude-fable-5-1`, `claude-opus-5`, `claude-opus-4-8`, `claude-sonnet-5`, `claude-sonnet-4-6`, `claude-fable-5`, `claude-haiku-4-5` | yes | yes except `claude-haiku-4-5` |
1390 | `openmodel` | `deepseek-v4-flash`; provider-scoped custom model IDs pass through | yes | model-dependent |
1391 | `sakana` | `fugu`, `fugu-ultra-20260615` | yes | yes for `fugu-ultra-20260615` |
1392 | `longcat` | `LongCat-2.0` | yes | yes |
1393 | `opencode-go` | `deepseek-v4-pro`, `grok-4.5`, `glm-5.2`, `glm-5.1`, `kimi-k3`, `kimi-k2.7-code`, `kimi-k2.6`, `deepseek-v4-flash`, `mimo-v2.5`, `mimo-v2.5-pro` | yes | yes |
1394 | `meta` | `muse-spark-1.3`, `muse-spark-1.3-contributor`, `muse-wonder-1.0`, `muse-spark-1.2`, `muse-spark-1.2-contributor` | yes | yes |
1395 | `xai` | `grok-4.6`, `grok-4.7`, `grok-4.5`, `grok-4.3`, `grok-build`, `grok-composer-2.5-fast`, `grok-4.20-0309-reasoning`, `grok-4.20-0309-non-reasoning` | yes | yes for `grok-4.6`, `grok-4.7`, `grok-4.5`, `grok-4.3`, `grok-build`, and `grok-4.20-0309-reasoning` |
1396 | `google` | `gemini-4-hydrogen`, `gemini-4-carbon`, `gemini-4-argon`, `gemini-3.1-pro-preview`, `gemini-3.8-flash`, `gemini-3.6-flash`, `gemini-3.5-flash-lite`, `gemini-2.5-pro`, `gemini-2.5-flash` | yes | yes except `gemini-3.5-flash-lite` |
1397 | `mistral` | `mistral-code-latest`, `mistral-medium-latest`, `mistral-small-latest`, `mistral-large-latest` | yes | yes for Medium and Small (`reasoning_effort` `none` or `high` on exact first-party routes); deprecated native Magistral remains an always-on explicit compatibility ID; no for Code and Large |
1398 | `modelstudio-token-plan`, `modelstudio-coding-plan` | `qwen3.8-max`, `qwen3.7-plus`, `qwen3.7-max`, `qwen3.6-flash`, `deepseek-v4-pro`, `deepseek-v4-flash-0731`, `glm-5.2`; the Token Plan also has `qwen4-max-preview` | yes except `qwen4-max-preview` (not published) | yes except `qwen4-max-preview` |
1399 | `csdn` | `glm_for_coding`; other marketplace model IDs pass through | yes | yes |
1400
1401 AtlasCloud keeps the same default model as the config layer and adds
1402 provider-scoped aliases for the Pro and Flash rows. Other AtlasCloud model IDs
1403 should still be selected through `ATLASCLOUD_MODEL`, config, or live model
1404 listing when available.
1405
1406 ## Capability Metadata
1407
1408 `codewhale doctor --json` exposes the `capability` object. It is static
1409 metadata, not a live API probe. Current fields are:
1410
1411 `resolved_provider`, `resolved_model`, `context_window`, `max_output`,
1412 `thinking_supported`, `cache_telemetry_supported`, and `request_payload_mode`.
1413
1414 When configuration cannot be loaded or validated, `doctor --json` exits
1415 nonzero and prints a bounded, secret-redacted JSON error envelope with
1416 `status = "error"` and `error.kind = "config_validation"` instead of emitting
1417 misleading route or capability metadata.
1418
1419 Most shipped providers use the Chat Completions request payload mode. Native
1420 Messages routes, including `minimax-anthropic`, use `/v1/messages`, and
1421 `openai-codex` uses Responses.
1422
1423 For OpenAI-compatible gateways or self-hosted runtimes whose real window
1424 differs from the static table, set `[providers.<name>] context_window = N`.
1425 The configured value becomes the route-effective context window for prompts,
1426 context-pressure checks, compaction, and output-cap budgeting.
1427
1428 `max_output` is optional and truthful: it is `null` (and omitted from the
1429 capability struct on the wire) when the route publishes no output maximum we
1430 can stand behind — the Kimi Code membership `kimi-for-coding` family is the
1431 canonical example, since the membership catalog owns their limits. An unknown
1432 output ceiling is never backfilled with a placeholder, and it applies **no**
1433 compatibility clamp to a turn's requested `max_tokens`; only a concrete
1434 route/offering maximum narrows the request. A model the catalogue simply has no
1435 row for is a different fact — absence is not permission, so an uncatalogued id
1436 keeps a conservative ceiling. The "Max output metadata" column below reads
1437 `unknown` wherever no documented maximum exists.
1438
1439 The exact Kimi Code membership roster contains `k3`, `k3-256k`,
1440 `kimi-for-coding`, and `kimi-for-coding-highspeed`. The two K3 ids share the
1441 same reasoning and fixed-sampling contract; `k3-256k` stays at 262,144 tokens,
1442 while bare `k3` can use an entitled 1M override.
1443
1444 | Provider/model class | Context window | Max output metadata | Thinking support | Cache telemetry | FIM endpoint |
1445 | --- | --- | --- | --- | --- | --- |
1446 | DeepSeek V4 (`deepseek-v4-pro`, `deepseek-v4-flash`) | 1,000,000 | 384,000 | yes | yes | DeepSeek beta only, on Chat Completions routes; not on the default Flash route, which speaks Responses |
1447 | DeepSeek V4 Flash Vision experimental (`deepseek-v4-flash-vision-exp`) | 1,000,000 inherited from Flash | 384,000 inherited from Flash | yes, inherited | yes, inherited | not claimed; Chat Completions route only |
1448 | DeepSeek compatibility aliases (`deepseek-chat`, `deepseek-reasoner`) | 1,000,000 | 384,000 | yes | yes | DeepSeek beta only |
1449 | NVIDIA NIM V4 registry models | 1,000,000 | 384,000 | yes | yes | not documented in code |
1450 | Volcengine Ark V4 model IDs | 1,000,000 | 384,000 | yes | yes | not documented in code |
1451 | OpenRouter, Novita, Fireworks, SiliconFlow, SGLang, and vLLM V4 model IDs | 1,000,000 | 384,000 | yes | no | not documented in code |
1452 | Xiaomi MiMo `mimo-v2.6-pro`, `mimo-v2.6-flash` | 1,048,576 | 131,072 | yes | no | not documented in code |
1453 | Xiaomi MiMo `mimo-v2.5-pro-ultraspeed` | 1,000,000 | 131,072 | yes | no | not documented in code |
1454 | OpenRouter Qwen 3.6 Flash / Plus | 1,000,000 | 65,536 | yes | no | not documented in code |
1455 | OpenRouter Qwen 3.6 35B / 27B | 262,144 | 262,140 | yes | no | not documented in code |
1456 | OpenRouter Qwen 3.6 Max Preview | 262,144 | 65,536 | yes | no | not documented in code |
1457 | OpenAI API `gpt-5.5` | 1,050,000 | 128,000 | yes | no | not documented in code |
1458 | OpenAI API `gpt-5.6`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna` | 1,050,000 | 128,000 | yes | no | not documented in code |
1459 | Anthropic API `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-haiku-5-5`, `claude-fable-5-2`, `claude-fable-5-1`, `claude-opus-5`, `claude-opus-4-8`, `claude-sonnet-5`, `claude-sonnet-4-6`, `claude-fable-5` | 1,000,000 | 128,000 | yes | yes | not documented in code |
1460 | Google Gemini API `gemini-4-hydrogen`, `gemini-4-carbon`, `gemini-4-argon` | 1,048,576 | 65,536 | model-dependent | no | not documented in code |
1461 | Google Gemini API `gemini-3.8-flash`, `gemini-3.6-flash`, `gemini-3.5-flash-lite`, `gemini-3.1-pro-preview`, `gemini-2.5-pro`, `gemini-2.5-flash` | 1,048,576 | 65,536 | model-dependent | no | not documented in code |
1462 | Meta Model API `muse-spark-1.3`, `muse-spark-1.3-contributor`, `muse-wonder-1.0` | 1,048,576 | not published | yes | no | not documented in code |
1463 | Meta Model API `muse-spark-1.2` | 1,000,000 | 32,000 | yes | no | not documented in code |
1464 | ChatGPT plan route (`openai-codex`) | conservatively budgeted; account listing does not state a window | no output cap sent in preview | model dependent | no | public `/v1/responses`; no context limit is inferred from account eligibility |
1465 | OpenModel default/custom model IDs | 200,000 fallback unless model metadata or config overrides it | 64,000 fallback | model-dependent | no | route uses Messages payload at `/v1/messages` |
1466 | Wanjie Ark `reasoner` / `r1` model IDs | 128,000 | unknown (no documented maximum) | yes | no | not documented in code |
1467 | Direct Arcee API `trinity-large-thinking` | 262,144 | 262,144 | yes | no | not documented in code |
1468 | Direct Arcee API `trinity-large-preview` | 262,144 | unknown (no documented maximum) | no in doctor capability metadata | no | not documented in code |
1469 | Direct Moonshot `kimi-k3` | 1,048,576 | 1,048,576 documented maximum; 131,072 provider default | yes | no | exact route uses `max_completion_tokens` and omits fixed sampling fields ([K3 quickstart](https://platform.kimi.ai/docs/guide/kimi-k3-quickstart)) |
1470 | Kimi Code membership `k3` | 262,144 safe baseline; 1,048,576 with an explicit entitled-plan override | 131,072 conservative default ceiling; membership maximum is not published | yes | no | exact `https://api.kimi.com/coding/v1` route |
1471 | Kimi Code membership `k3-256k` | 262,144 fixed | 131,072 conservative default ceiling; membership maximum is not published | yes | no | exact `https://api.kimi.com/coding/v1` route |
1472 | Direct Moonshot/Kimi K2.7/K2.6 (`kimi-k2.7-code`, `kimi-k2.7-code-highspeed`, `kimi-k2.6`) | 262,144 | 32,768 | yes | no | provider-reported bundled catalog |
1473 | Kimi Code membership `kimi-for-coding`, `kimi-for-coding-highspeed` | 262,144 | unknown — the membership catalog owns these limits and no client-side ceiling is claimed | yes | no | exact `https://api.kimi.com/coding/v1` route |
1474 | Direct Z.AI `GLM-5.4` | 1,000,000 | 131,072 | yes | no | live on the Z.ai / BigModel GLM Coding Plan with image, video, and PDF input; no USD price |
1475 | Direct Z.AI `GLM-5.3` (default) | 1,000,000 | 131,072 | yes | no | live on the GLM Coding Plan; limits inherited from `GLM-5.2` until Z.ai publishes distinct 5.3 numbers; no USD price |
1476 | Direct Z.AI `GLM-5.3-Flash` | 1,000,000 | 131,072 | yes | no | natively multimodal; $0.15/$0.50 list (2026-08-26); faster/explore sibling of `GLM-5.3` |
1477 | Direct Z.AI `GLM-5.2` | 1,000,000 | 131,072 | yes | no | not documented in code |
1478 | Direct Z.AI `GLM-5.1` | 202,752 | 131,072 | yes | no | not documented in code |
1479 | Direct Z.AI `GLM-5-Turbo` | 202,752 | 131,072 | yes | no | faster/explore sub-agent sibling |
1480 | Direct MiniMax `MiniMax-M3` | 1,000,000 | 524,288 | yes | no | not documented in code |
1481 | Direct MiniMax M2.x models | 204,800 | unknown until MiniMax output metadata is promoted | yes | no | not documented in code |
1482 | MiniMax Messages route (`MiniMax-M3`, `MiniMax-M2.7`) | model-specific values above | model-specific values above | yes | no | route uses `/anthropic/v1/messages` |
1483 | Generic `openai` and AtlasCloud | 128,000 | unknown (no documented maximum) | no in doctor capability metadata | no | not documented in code |
1484 | Ollama | 8,192 | unknown (no documented maximum) | no | no | not documented in code |
1485 | Hugging Face Inference Providers V4 model IDs | 131,072 | unknown (no documented maximum) | yes | no | not documented in code |
1486 | Other recognized DeepSeek model IDs | 128,000 unless the model name carries an explicit `Nk` hint | unknown (no documented maximum) | no unless V4/reasoner logic matches | DeepSeek/NIM only | DeepSeek beta only |
1487
1488 MiniMax M3 uses input-length and service tiers. Codewhale omits
1489 `service_tier`, so requests use the standard tier and cost estimates select the
1490 correct standard rate from total input usage. Priority rates are listed to keep
1491 the official tier structure visible. Prices are USD per million tokens.
1492
1493 | Model / service tier | Input length | Input | Output | Cache read | Cache write |
1494 | --- | --- | ---: | ---: | ---: | ---: |
1495 | `MiniMax-M3` standard | up to 512,000 input tokens | $0.30 | $1.20 | $0.06 | not published |
1496 | `MiniMax-M3` standard | over 512,000 input tokens | $0.60 | $2.40 | $0.12 | not published |
1497 | `MiniMax-M3` priority | up to 512,000 input tokens | $0.45 | $1.80 | $0.09 | not published |
1498 | `MiniMax-M3` priority | over 512,000 input tokens | $0.90 | $3.60 | $0.18 | not published |
1499 | `MiniMax-M2.7` standard | all supported inputs | $0.30 | $1.20 | $0.06 | $0.375 |
1500
1501 These values come from the [MiniMax pay-as-you-go pricing
1502 guide](https://platform.minimax.io/docs/guides/pricing-paygo). M3 thinking is
1503 adaptive or disabled; the OpenAI-compatible API defaults to adaptive and the
1504 Anthropic-compatible API defaults to disabled. M2.7 thinking cannot be
1505 disabled. Codewhale sends explicit controls when the user selects a reasoning
1506 mode.
1507
1508 Tool-call support is tracked separately by the reviewed catalog selections and by
1509 the endpoint's ability to accept OpenAI-compatible `tools` payloads. A custom
1510 OpenAI-compatible or local endpoint can still reject tool calls even if
1511 Codewhale can send the schema.
1512
1513 ### Hugging Face Inference Providers Notes
1514
1515 The shipped Hugging Face route targets the OpenAI-compatible Inference Providers
1516 router at `https://router.huggingface.co/v1`. Configure auth with
1517 `HUGGINGFACE_API_KEY` first, or `HF_TOKEN` as a fallback. Configure the endpoint
1518 with `HUGGINGFACE_BASE_URL` first, or `HF_BASE_URL` as a fallback; configure the
1519 model with `HUGGINGFACE_MODEL` first, or `HF_MODEL` as a fallback.
1520
1521 This route does not imply Hub browsing, model-card metadata, dataset access,
1522 Jobs, uploads, or export. Those remain explicit Model Lab work items so
1523 provider auth and artifact movement stay separate.
1524
1525 ### When a Local Model Prints Tool JSON
1526
1527 Codewhale only executes tools when the provider returns Chat Completions
1528 `tool_calls` or streamed `delta.tool_calls`. If a local model prints text such
1529 as `{"name":"File","arguments":{"action":"search_content",...}}` in the
1530 assistant message, that is ordinary model output, not an executable tool
1531 request.
1532
1533 For OpenAI-compatible or local runtimes, check:
1534
1535 - The endpoint accepts the `tools` array in `/v1/chat/completions` requests.
1536 - The selected model or chat template is configured for function/tool calls.
1537 - The server returns `tool_calls` in the response rather than plain JSON text.
1538 - The compatibility layer does not strip tools before forwarding the request.
1539 - If in doubt, test a small `File` `read` or `search_content` action against a
1540 known tool-calling model before debugging Codewhale's tool registry.
1541
1542 Changing `provider`, `base_url`, or `model` can select a route that supports the
1543 OpenAI-compatible payload shape, but Codewhale cannot convert arbitrary JSON
1544 text into a trusted tool call after the model has emitted it as prose.
1545
1546 DeepSeek retired `deepseek-chat` and `deepseek-reasoner` on 2026-07-24 at
1547 15:59 UTC. Codewhale migrates either name to `deepseek-flash` before a
1548 request reaches DeepSeek's first-party OpenAI or Anthropic endpoint. If no
1549 reasoning tier was configured, `deepseek-chat` also migrates to `off` and
1550 `deepseek-reasoner` to `high`, preserving their former non-thinking / thinking
1551 intent; an explicit `reasoning_effort` remains authoritative. The mapping is
1552 deliberately not global: Wanjie Ark, aggregators, self-hosted runtimes, and
1553 custom endpoints continue to own their model ids.
1554
1555 ## Reasoning Effort
1556
1557 `/reasoning <effort>` (and the `reasoning_effort` config key) is translated to
1558 each provider's wire dialect by the client before the request is sent. `off`
1559 disables thinking where the route supports it. Both exact K3 routes map `off`
1560 to their lowest supported tier, `low`, and the model is never switched to
1561 satisfy `off` — but they do so for different reasons:
1562
1563 - **Kimi Code membership K3** (exact `https://api.kimi.com/coding/v1` with
1564 `model = "k3"` or `model = "k3-256k"`) — the membership roster declares K3 always-thinking, so `off`
1565 cannot be honored without changing what the model is. The clamp preserves the
1566 fixed K3 identity.
1567 - **Direct Moonshot K3** (exact `https://api.moonshot.ai/v1` with
1568 `model = "kimi-k3"`) — this clamp is *defensive*, not a documented contract.
1569 The direct platform publishes no `off` state for K3, and Codewhale will not
1570 assert a fixed-thinking guarantee it cannot verify for a given key's
1571 entitlement, so the requested `off` is normalized to the lowest tier with the
1572 live entitlement left unknown.
1573
1574 Normal dispatched
1575 `auto` uses Codewhale's auto-reasoning selector and sends a concrete tier;
1576 only an omitted reasoning setting leaves the provider default in control.
1577 Providers marked "omitted" receive no reasoning fields at all for that tier.
1578
1579 | Provider | `off` | `low`/`medium`/`high` | `max`/`xhigh` |
1580 | --- | --- | --- | --- |
1581 | `deepseek`, `deepseek-cn`, `siliconflow`, `siliconflow-CN`, `sglang`, `volcengine`, `atlascloud` | `thinking: {type: disabled}` | `reasoning_effort: "high"` + `thinking: {type: enabled}` | `reasoning_effort: "max"` + `thinking: {type: enabled}` |
1582 | `openrouter`, `novita`, other `together` models | `thinking: {type: disabled}` | `reasoning_effort` pass-through + `thinking: {type: enabled}` | `reasoning_effort: "xhigh"` + `thinking: {type: enabled}` |
1583 | `together` + `thinkingmachines/inkling` | `reasoning_effort: "none"` | exact `minimal`/`low`/`medium`/`high` `reasoning_effort` | `reasoning_effort: "max"` |
1584 | Direct Moonshot `kimi-k3` at exact `https://api.moonshot.ai/v1` | top-level `reasoning_effort: "low"` (effective normalization) | top-level `reasoning_effort: "low"` / `"high"` (`medium` becomes `high`) | top-level `reasoning_effort: "max"` |
1585 | Kimi Code membership `k3`, `k3-256k` at exact `https://api.kimi.com/coding/v1` | `thinking: {type: enabled, effort: "low"}` (effective normalization) | `thinking: {type: enabled, effort: "low" | "high"}` | `thinking: {type: enabled, effort: "max"}` |
1586 | Other `moonshot` routes | `thinking: {type: disabled}` | `thinking: {type: enabled}` | `thinking: {type: enabled}` |
1587 | `ollama` | `think: false` | `think: true` | `think: true` |
1588 | `ollama-cloud` | `reasoning_effort: "none"` | exact `low`/`medium`/`high` `reasoning_effort` | `reasoning_effort: "max"` |
1589 | `xiaomi-mimo` | `thinking: {type: disabled}` | `thinking: {type: enabled}` | `thinking: {type: enabled}` |
1590 | First-party `minimax` `MiniMax-M3` | `reasoning_split: true` + `thinking: {type: disabled}` | `reasoning_split: true` + `thinking: {type: adaptive}`; effective tier granularity unavailable | `reasoning_split: true` + `thinking: {type: adaptive}`; effective tier granularity unavailable |
1591 | First-party Z.ai `GLM-5.4` | `thinking: {type: disabled}`; no `reasoning_effort` | enabled thinking; only effective `high` adds `reasoning_effort: "high"` | enabled thinking + `reasoning_effort: "max"` |
1592 | First-party Z.ai `GLM-5.2` | `thinking: {type: disabled}`; no `reasoning_effort` | enabled thinking; only effective `high` adds `reasoning_effort: "high"` | enabled thinking + `reasoning_effort: "max"` |
1593 | First-party Z.ai `GLM-5.3` | `thinking: {type: disabled}`; no `reasoning_effort` | enabled thinking; only effective `high` adds `reasoning_effort: "high"` | enabled thinking + `reasoning_effort: "max"` |
1594 | First-party Z.ai `GLM-5.3-Flash` | `thinking: {type: disabled}`; no `reasoning_effort` | enabled thinking; only effective `high` adds `reasoning_effort: "high"` | enabled thinking + `reasoning_effort: "max"` |
1595 | First-party Z.ai `GLM-5-Turbo` | `thinking: {type: disabled}` | enabled thinking; effort granularity unavailable | enabled thinking; effort granularity unavailable |
1596 | Compatible gateways configured as `zai` | omitted; effective unavailable | omitted; effective unavailable | omitted; effective unavailable |
1597 | `nvidia-nim` | `chat_template_kwargs.thinking: false` | `chat_template_kwargs`: `thinking: true` + `reasoning_effort: "high"` | `chat_template_kwargs`: `thinking: true` + `reasoning_effort: "max"` |
1598 | `vllm` | `chat_template_kwargs.enable_thinking: false` | `chat_template_kwargs.enable_thinking: true` + `reasoning_effort` low/medium/high | `chat_template_kwargs.enable_thinking: true` + `reasoning_effort: "high"` (vLLM has no max tier) |
1599 | `arcee`, `huggingface` | omitted | `reasoning_effort` pass-through | `reasoning_effort: "high"` |
1600 | `fireworks` | omitted | `reasoning_effort: "high"` | `reasoning_effort: "max"` |
1601 | `openai`, `wanjie-ark`, `telecomjs` | omitted | omitted | omitted |
1602 | `openmodel` | Anthropic Messages adapter handles thinking/output configuration | Anthropic Messages adapter handles thinking/output configuration | Anthropic Messages adapter handles thinking/output configuration |
1603 | `openai-codex` | Responses API `reasoning` field (handled by the Responses bridge) | Responses API `reasoning` field | Responses API `reasoning` field |
1604
1605 AtlasCloud serves DeepSeek models, so it speaks the DeepSeek reasoning dialect,
1606 including the `max` tier (#3024).
1607
1608 On the exact MiniMax OpenAI-compatible Chat endpoints, `MiniMax-M3` uses
1609 `max_completion_tokens`. Other MiniMax models and compatible gateways retain
1610 `max_tokens`; the MiniMax Anthropic endpoints use the separate Messages
1611 adapter.
1612
1613 ## Drift Check
1614
1615 Run this before changing provider IDs, provider TOML tables, static model
1616 registry rows, or provider default strings:
1617
1618 ```bash
1619 python3 scripts/check-provider-registry.py
1620 ```
1621
1622 The check fails when:
1623
1624 - `docs/PROVIDERS.md` omits a canonical `ProviderKind::as_str()` ID.
1625 - Descriptor presentation IDs or released wire tags are duplicated or drift
1626 from intrinsic kinds, or a second provider enum/ordinal bridge is introduced.
1627 - The shipped-provider table omits or adds a `[providers.*]` TOML table.
1628 - The static model registry table drifts from providers used by
1629 the reviewed catalog selections.
1630 - A provider default model or base URL constant in
1631 `crates/config/assets/provider_descriptors.json` is no longer mentioned here.
1632
1633 ## Provider Gotchas
1634
1635 Three failures that look like something else (measured by a provider operator
1636 on live traffic):
1637
1638 - **A cold model looks broken.** The first call to a model the provider has not
1639 loaded can take 90 to 150 seconds, then drop to a second or less once warm.
1640 Raise `[stream].open_timeout_secs` (default 180 seconds, at most 600) before reading a timeout as "model unavailable". A request that gets no response headers in that time is sent again once (`[stream].open_retries`).
1641 - **Listed is not callable.** A catalog entry can be visible and still fail
1642 every call. The same error text on every attempt (for example a "resources
1643 busy" 502) is not transient: a genuinely busy upstream returns successes in
1644 between. Probe a model before trusting it, and stop retrying one that fails
1645 identically.
1646 - **A truncated answer can report `stop`.** A reasoning model can spend the
1647 whole `max_tokens` allowance on reasoning. When the provider reports
1648 `completion_tokens` exactly equal to the `max_tokens` the request asked for
1649 and the finish reason is `stop`, Codewhale treats the turn as cut at the
1650 ceiling rather than finished (`stop_contradicts_output_ceiling` in
1651 `codewhale-models`); retrying the same prompt stops at the same count, so
1652 raise the ceiling or shorten the task instead. No inference is made when the
1653 provider reports no usage.
1654
1655 ## Planned, Not Shipped Yet
1656
1657 These items belong to the 0.11 provider-profile milestone (see the
1658 [roadmap](ROADMAP.md)) or related provider docs work, but they are not native shipped behavior in this checkout:
1659
1660 - A unified `Provider` trait that owns env precedence,
1661 secret resolution, base URL normalization, auth-header construction, and
1662 provider metadata. Those responsibilities are still split across
1663 `crates/config`, `crates/secrets`, and `crates/engine/src/client.rs`.
1664 - Hugging Face model passport metadata in the picker, including license, base
1665 model, context length, chat template, tool-call support, reasoning support,
1666 and gated/private status.
1667
1668 ## Claude subscription sign-in (removed)
1669
1670 Claude Pro/Max sign-in has been removed: `codewhale auth claude`,
1671 `/auth claude` and the Claude choice in `/provider setup anthropic`. It used
1672 Claude Code's sign-in, which Anthropic doesn't allow other apps to use. Use an
1673 Anthropic API key instead, through `codewhale auth set --provider anthropic`,
1674 `/provider setup anthropic` or `ANTHROPIC_API_KEY`.
1675
1676 A config that still selects `auth_mode = "oauth"` under `[providers.anthropic]`
1677 fails with that guidance. It never falls back to an API key on its own, so
1678 billing changes only when you save an Anthropic key. Codewhale does not delete
1679 a saved Claude sign-in: its `claude-*.json` files stay in the `credentials`
1680 folder of your Codewhale home until you delete them or run `codewhale logout`,
1681 which removes every saved credential. End remote access in your Claude account
1682 settings.
1683
1684 ## Claude organization billing (`auth_mode = "claude-org"`)
1685
1686 This is not the removed subscription sign-in. It links a Claude Platform (API)
1687 organization to your Codewhale account, and Anthropic then bills that
1688 organization directly for the requests Codewhale sends with it.
1689
1690 1. Sign in to Codewhale: `codewhale login`.
1691 2. Link the organization: `codewhale account claude-org link`. Codewhale prints
1692 a link on the Codewhale account API's own origin
1693 (`/api/claude-billing/start`, which confirms and then hands over to Claude),
1694 tries to open it in a browser and waits up to 10 minutes for the link to
1695 finish. Any other URL is refused. If an organization is already linked it
1696 says so and opens nothing. `codewhale account claude-org status` and
1697 `codewhale account claude-org unlink` show and remove the link.
1698 3. Select the mode:
1699
1700 ```toml
1701 [providers.anthropic]
1702 auth_mode = "claude-org"
1703 ```
1704
1705 The desktop does the same through the app server's browser-connect routes, the
1706 ones OrcaRouter uses. `POST /v1/providers/anthropic/connect` checks the link,
1707 asks the control plane for the start URL (validated exactly as the CLI does)
1708 and returns `{attemptId, authorizeUrl, expiresIn: 600}`; `authorizeUrl` is
1709 `null` when the account is already linked. The app server never opens a
1710 browser. A worker polls the link every 3 seconds; once it is linked it writes
1711 `auth_mode = "claude-org"` under `[providers.anthropic]` in the same file that
1712 saved API-key markers go to (the user-global config when the app server runs
1713 on a workspace-scoped config) and updates the running config. `GET /v1/providers/anthropic/connect/{attemptId}` reports
1714 `waiting`, `connected`, `expired` (10 minutes passed), `cancelled` or `failed`
1715 with a `reason`: `not_signed_in`, `claude_billing_disabled`,
1716 `already_linked_elsewhere`, `unavailable`, `invalid_response`,
1717 `not_writable`, `config_not_saved`, `custom_endpoint` or `link_failed`; it
1718 ends `declined` when the control plane reports the browser link was declined
1719 (`lastLinkFailure`), and `already_linked_elsewhere` or `link_failed` for its
1720 other failure codes. A start that fails returns the same reason as
1721 `error.code`. The provider row offers `browserConnect` for anthropic only
1722 while the account's last `GET /api/claude-billing` said `available: true`.
1723 The app server refreshes that in the background at most every 10 minutes when
1724 `GET /v1/providers` finds it stale, and a connect attempt that sees billing
1725 disabled turns it off. Known limit: right after start, or with no Codewhale
1726 session, the first provider list shows no option until that probe returns.
1727 Clearing the Anthropic key cancels a waiting attempt. Saving an Anthropic API key through
1728 `PUT /v1/providers/anthropic/key` replaces `claude-org` with `api_key`, so the
1729 pasted key is the one used.
1730
1731 In this mode each request fetches a short-lived connection token from the
1732 Codewhale control plane (`POST /api/claude-billing/token`, authenticated with
1733 your Codewhale session) and sends it to `https://api.anthropic.com` as
1734 `Authorization: Bearer`, with no `x-api-key` and with the `anthropic-version`
1735 the control plane returns instead of `2023-06-01`. When the token response
1736 names a `userProfileId`, every request also sends `anthropic-user-profile-id`
1737 and adds `user-profiles-billing-2026-10-01` to any existing `anthropic-beta`
1738 values, and `/v1/messages` bodies carry
1739 `"billing_policy": {"type": "billing_policy", "bill_to": "user_profile"}`
1740 (not `/v1/models` or token counting). The token is reused until it
1741 is within two minutes of expiry; a 401 from Anthropic refetches it and retries
1742 the request once. The token is sent only to the origin the control plane bound
1743 it to, and only on the official Anthropic endpoint: a custom `base_url` with
1744 this mode fails at load. A session provider key from the app server still wins
1745 over the linked organization, and session-only key policy refuses this mode.
1746
1747 Errors say what to do. Not signed in to Codewhale: run `codewhale login`. No
1748 organization linked, or the link ended: run `codewhale account claude-org link`.
1749 A 402 `linked_organization_spend_limit_reached` or
1750 `linked_organization_billing_unavailable` means your organization's spend cap
1751 or credit stopped the request: check Linked platforms and Billing in the Claude
1752 Console. A 403 `user_profile_not_billable` means the link ended or the
1753 organization cannot be billed: run `codewhale account claude-org link` and
1754 check Linked platforms in the Claude Console. Those are never retried. When the
1755 Codewhale control plane is temporarily unavailable the request is not sent and
1756 is retried like a connection failure.
1757
1758 Known limits: readiness reports the mode as configured without checking that a
1759 link exists; the first request does that. The token cache lives in one client,
1760 so a new client fetches a fresh token. API-key users are unaffected, and the
1761 mode is never selected by default.
1762
1762 lines MARKDOWN