Reference·Models and providersIndex

Models and providers

Providers, wire dialects, key lookup, default and auxiliary model, effort, retries and failover.

.mdllms.txt

A provider is an endpoint, a key and the wire dialect it speaks. Providers live in ~/.nodecode/config.jsonc.

Providers

~/.nodecode/config.jsonc
"providers": {
  "anthropic": { "sdk": "anthropic", "api_key": "sk-ant-..." },
  "local": {
    "sdk": "openai-completions",
    "base_url": "http://127.0.0.1:8000/v1",
    "models": [{ "id": "qwen3-27b" }]
  }
}

Every provider key is listed in Config. /connect saves a key for a provider from the models.dev catalog.

Dialects

sdk names the wire dialect. Nodecode never probes the endpoint for it.

sdkPath added to base_urlDefault endpoint
openai-completions/chat/completionshttps://opencode.ai/zen/v1/chat/completions
openai-responses/responseshttps://api.openai.com/v1/responses
anthropic/messageshttps://api.anthropic.com/v1/messages
googleSet per modelhttps://generativelanguage.googleapis.com/v1beta
CaseDialect used
sdk is setThat dialect. An unknown value leaves the provider unusable.
No sdk, the id is a dialect nameThat dialect. Example: "anthropic": {}.
No sdk, any other idRefused. The refusal names the key to set.
No config entryThe dialect of the id, or of its models.dev catalog entry.
models[].sdk is setThat dialect, for that model only.

base_url

RuleDetail
CompositionTrailing slashes are trimmed. The dialect path is appended.
Version segmentInclude it. Write https://host/v1.
No base_url, id openai-completions, anthropic or googleThe default endpoint of that dialect.
No base_url, id openai-responses or openaihttps://api.openai.com/v1/responses.
No base_url, a models.dev catalog providerThe catalog's api address.
No base_url, anything elseRefused. Set providers.<id>.base_url.
NODECODE_ENDPOINTOverrides every rule above. It is the full endpoint URL.

Keys

Nodecode takes the first key found, in this order.

OrderSource
1NODECODE_API_KEY
2providers.<id>.api_key in the config
3~/.nodecode/auth.json, at api_keys.<id>.key. /connect writes it.
4A cell's credential hook
5<ID>_API_KEY. The id is uppercased, - becomes _.
6OPENAI_API_KEY, ANTHROPIC_API_KEY or GOOGLE_API_KEY, by dialect
7ANTHROPIC_AUTH_TOKEN, for the provider id anthropic only
8The literal string public
! commandResult
SuccessThe trimmed output is the key.
Runs past 10 secondsResolution fails.
Non-zero exit or empty outputResolution fails.

A provider with no key anywhere sends public as its key. An auth.json that is unreadable, invalid or over 1 MiB stops resolution.

Default and auxiliary model

~/.nodecode/config.jsonc
"general": {
  "default_model":   { "provider": "anthropic", "model": "claude-opus-5", "effort": "high" },
  "auxiliary_model": { "provider": "local", "model": "qwen3-27b" }
}
KeyUsed forWhen unset
general.default_modelNew sessions.The build default applies. The footer reads run /setup to add a model.
general.auxiliary_modelSide work, such as naming a session.The session's own model, at its weakest effort rung.

Both take provider, model and an optional effort. provider and model are required. The older string form of default_model is refused.

Session pinning

A model pick pins the session. The pin survives restarts.

EventResult
/models pickPins this session. Writes general.default_model.
A session that already ranKeeps its own model.
(select-model nil) in evalClears the pin. The session takes the default at its next turn.
Attached shellsTheir footers follow the pick.

/models and /model-aux

CommandDoes
/modelsOpens the catalog picker. Headless: prints the current target.
/models MODELPicks a model on the current provider.
/models PROVIDER MODELPicks a provider and a model.
/models list [PROVIDER]Prints the catalog, or one provider's models.
/models refreshDrops the cached listings, then opens the picker.
/model-auxSame forms. Writes general.auxiliary_model. Pins no session.

The picker lists each provider from GET <base_url>/models.

CacheFileKept
Provider listings~/.cache/nodecode/provider-models.json600 seconds. A failed listing: 60 seconds.
models.dev catalog~/.cache/nodecode/models.dev/api.jsonPath override: NODECODE_MODELS_CATALOG.

/think and effort

The ladder, weakest first: off, minimal, low, medium, high, xhigh, max. A model offers the rungs it declares.

CommandDoes
/thinkOpens the reasoning controls. Headless: prints the effort and the ladder.
/think RUNGSets the effort for this session and every new session. Applies from the next turn.
/think defaultUses the model's own reasoning.
/effortAlias of /think.
SourceDetail
general.default_model.effortThe default effort. /think writes it when default_model is set.
NODECODE_REASONING_EFFORTOutranks the config default.
A session's /think pickOutranks both.
DialectEffort on the wire
openai-completions, openai-responsesSent as written.
googleClamped to high.
anthropicAn adaptive effort or a thinking budget, by what the model declares.

Retries

Set these per provider, under providers.<id>.

KeyDefaultCounts
request_max_retries4Failures before any stream bytes. Counted per stream attempt.
stream_max_retries5Failures after the response started.
stream_idle_timeout_ms120000Milliseconds with no byte before the attempt fails.
stream_rerun_ceiling_seconds120A stream cut after this much output is continued. 0: always re-run.

The two retry budgets multiply. A stream that keeps sending bytes has no time limit.

HTTP statusRetried
None: network error, timeout, cut stream, empty responseYes
408, 409, 425, 429Yes
500 and aboveYes
400, 401, 403, 404, 413, 422 and every other statusNo
Delay ruleValue
Retry-After headerUsed as sent, capped at 60 seconds.
No header0.2 seconds, doubling to 8 seconds, with 10% jitter.
Status 503Starts at 5 seconds, capped at 60 seconds.
Refused connectionSpends the request budget at once.

A context overflow is handled apart: 413, or 400 with an overflow message. Nodecode evicts old history and retries, up to 8 times. See Context.

Failover

~/.nodecode/config.jsonc
"failover": {
  "chain": [
    { "provider": "local", "model": "qwen3-27b" }
  ]
}
RuleDetail
StartThe retries of the selected model are spent on a retryable failure.
OrderThe round re-runs on the next entry of the chain.
On a chain entryA failure that no retry cures moves to the next entry.
ScopeOne turn. The next turn starts on the selected model.
KeyEach entry resolves its own key. NODECODE_API_KEY is not used for it.
Bad entryAn entry without provider or model is skipped with a warning.
No chainNo failover.

Environment

NODECODE_PROVIDER, NODECODE_MODEL, NODECODE_API_KEY, NODECODE_ENDPOINT and NODECODE_REASONING_EFFORT override the config for one process. See Environment variables.

Esc

    Loading the index…

    ↑↓ moveEnter openEsc close