Reference·Models and providersIndex

Models and providers

Providers, wire dialects, key lookup, Nodecode's own models, default and auxiliary model, effort, retries and the failover chain.

.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": "gemma-3-27b" }]
  }
}

Every provider key is listed in Config. /models connects a provider from the models.dev catalog and saves its key in auth.json. Ctrl+E on a connected provider replaces its key.

A provider whose base_url is a machine of your own, on localhost, your LAN or your tailnet, is listed under Local in /models. Its models come from GET <base_url>/models.

Ollama needs no entry. Each time /models or /setup opens, Nodecode asks http://127.0.0.1:11434/v1/models, or the address in OLLAMA_HOST, and lists the models Ollama answers with under Local. The provider list shows Ollama either way. While Ollama is not running or has no model, Enter on it says what to do and asks again. A model pulled or removed shows on the next open. A providers.ollama entry of your own replaces the built-in one.

Ollama gives a model a 4K context window by default on a GPU with less than 24 GiB of memory, and recommends at least 64K for agents. Set OLLAMA_CONTEXT_LENGTH=64000 before ollama serve (Ollama: context length).

A request to openrouter.ai carries HTTP-Referer: https://nodecode.ai and X-OpenRouter-Title: Nodecode, which credit the tokens to Nodecode on OpenRouter's app rankings. No other host gets them.

A chat request to api.mistral.ai carries no reasoning_content on its messages. Mistral refuses a message field its schema does not name, so a DeepSeek model it hosts would fail every turn after the first.

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. /models writes it when you connect a provider.
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.

Nodecode's own models

nodecode.ai serves Nodecode's own models at https://api.nodecode.ai/v1, on OpenAI's wire, under the provider id nodecode.

nodecode login, or /login in the shell, signs in at nodecode.ai in a browser, to run on the account's API credit. It saves the key in auth.json, at api_keys.nodecode.key, and writes the provider:

~/.nodecode/config.jsonc
"providers": {
  "nodecode": { "sdk": "openai-completions", "base_url": "https://api.nodecode.ai/v1" }
}

A sign-in never changes your default model. Pick one in /models: nodecode, then Cyber v1.

ModelIdWhat it is
Cyber v1nodecode-cyber-v1The security model. A chat model: 1M context, prompt and output together, and 16K output unless a call asks for more. A session can run on it.
Image v1nodecode-image-v1The image model, at POST /v1/images/generations. The images come back in the body as b64_json, never as URLs.
Decide v1nodecode-decide-v1The classifier. It answers named questions about one state as probabilities, never prose. 32K context.
FactValue
KeysStart with sk-nc-. A key made at https://nodecode.ai/account/keys works the same. Any other key answers 401 invalid_api_key: run nodecode login again.
Who paysThe topped-up balance, per token; a plan the account already holds pays first. With neither, a call answers 402. A free key pays nothing. See Pricing.
What is leftGET /v1/usage: the plan's requests left, its reset and seats, the credit. The shell's footer and /usage show it.

Calling these models from outside Nodecode is on a page of its own: the API quickstart has the routes, a first call, and Claude Code, Codex and the pentest agents on Cyber v1.

Free key

Cyber v1 is free from the Nodecode CLI once your account has topped up at least $2 (or €2). The top-up stays in your balance.

  1. Top up at https://nodecode.ai/account/top-up.
  2. Run nodecode login (or /login in a shell) and press Allow with a free key on the page it opens.

The CLI saves two keys: the account's key (provider nodecode) and the free key beside it (provider nodecode-free). /models lists Cyber v1 twice at the top:

RowWho pays
nodecode-free/nodecode-cyber-v1 FREENobody: the free key, with the limits below. A sign-in with a free key makes it the default model.
nodecode/nodecode-cyber-v1Your plan or your balance, per token, with the full 1M context. Its row says which, e.g. from credit $2.00.

The footer shows Free key · Cyber v1 while a session runs on the free one, and your plan or credit otherwise; /usage lists both.

FactValue
Modelnodecode-cyber-v1 alone. Another model answers 403 model_not_free.
ClientThe Nodecode CLI alone. Any other client answers 403 free_needs_nodecode. Claude Code, Codex and your own code take a paid key.
Context1M, prompt and output together, the same as a paid key. A longer prompt answers 400 context_length_exceeded.
At once2 requests per account; 1 for 14 days after your first card top-up.
A day10M tokens (input not read from the cache, and output) in any 24 hours; 3M for 14 days after your first card top-up. Past it, 429 free_daily_used, saying when the account can send again (when enough of its oldest tokens leave the 24 hours), with Retry-After in seconds.
A minute30 requests per account. The next answers 429 free_rate_limited with Retry-After, which the CLI waits out.
CapacityPaid calls go first. A free call runs where a machine has room, and answers 503 free_capacity_busy after 30 s without it.
FooterFree key · Cyber v1; Free key · top up first while the top-up is unpaid.

A free key made at https://nodecode.ai/account/keys (tick Free key) runs without a sign-in once its provider is wired the way a sign-in wires it. A key alone names no provider or model, so NODECODE_API_KEY by itself runs no turn. Merge this into your config:

~/.nodecode/config.jsonc
{
  "general": { "default_model": { "provider": "nodecode-free", "model": "nodecode-cyber-v1" } },
  "providers": {
    "nodecode-free": { "sdk": "openai-completions", "base_url": "https://api.nodecode.ai/v1" }
  }
}

Then hand it the key and run nodecode:

a shell
export NODECODE_FREE_API_KEY=sk-nc-...

general.default_model makes the free Cyber v1 the default, as a sign-in with a free key does. Leave it out to pick it in /models instead.

Default and auxiliary model

~/.nodecode/config.jsonc
"general": {
  "default_model":   { "provider": "anthropic", "model": "claude-opus-5", "effort": "high" },
  "auxiliary_model": { "provider": "local", "model": "gemma-3-27b" }
}
KeyUsed forWhen unset
general.default_modelNew sessions.The build default applies. The footer reads run /setup to add a model.
general.auxiliary_modelSession names, recaps and summaries.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.
A child session, such as a forkStarts on its parent's provider, model and effort.
(select-model nil) in evalClears the pin. The session takes the default at its next turn.
Attached shellsTheir footers follow the pick.

/models

/models opens the providers under four tabs: Main, Auxiliary, Decider and Backup. Tab moves between them. Decider is the model that answers judgments as probabilities. Backup is the failover chain. In a chat room or on the web page, the same choices are rows.

TabDoes
MainPicks a provider, then a model: this session's, and the one new sessions start on. Then the model's reasoning ladder opens.
AuxiliaryPicks the model that names sessions and writes recaps and summaries, in general.auxiliary_model. Pins no session. Same as main gives that work back to each session's own model.
DeciderPins a decider in general.decider_model. The one decider is djev. None removes the pin.
BackupThe failover chain and its triggers.

The decider pin offers djev, a decider on a machine of your own. Decide v1, nodecode.ai's hosted classifier, is called by its id and is not offered there.

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.

/think, or its alias /effort, offers the rungs of the model's ladder, the one in use marked, and Default first.

RowDoes
A rungSets the effort for this session and every new session. Applies from the next turn.
autoOffered while a decider is pinned. The decider picks each turn's rung.
DefaultUses the model's own reasoning.

With auto, the decider reads each turn's ask before its first round and picks one of the model's own rungs, never off. That rung binds the whole turn, the same as a /think pick. If no decider is pinned, or it fails or takes more than 10 seconds, the turn runs at the default effort instead, or the model's own reasoning when the default is auto too. The failure stays in /status until a call succeeds. auto can also be set as general.default_model.effort.

While a turn runs, the footer shows the effort its requests carry: (auto: high) after the decider picked high, or the rung a :round hook moved it to. Between turns it shows the pick.

SourceDetail
general.default_model.effortThe default effort: a rung, or auto. /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.

A model declares its rungs in the models.dev catalog, under its id. A gateway that names a model its own way is in no catalog, so declare its rungs on its providers.<id>.models[] entry with reasoning_options, in the models.dev shape. They outrank the catalog. See Configuration.

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. Once the answer has started, three times this with no new text, reasoning or tool input fails it too.
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 content has no time limit. Keep-alives and empty chunks alone don't keep it going.

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

The failover chain is the backup models a failing round moves to, in order. Every session and every channel shares it. Set it on the Backup tab of /models, or in the config:

~/.nodecode/config.jsonc
"failover": {
  "chain": [
    { "provider": "local", "model": "gemma-3-27b" }
  ],
  "on": ["rate_limit", "outage", "slow_start", "broken_answer", "refusal"],
  "first_token_seconds": 60
}

on names the failures that move a round to the chain.

Triggeron idThe failure
rate limitrate_limitA 429.
outageoutageA server or transport failure, a timeout or a stall. Also a status no retry cures: a rejected key, a spent balance, a model the provider does not serve.
slow startslow_startAn attempt that streamed no token by its deadline, or was skipped while it waited.
broken answerbroken_answerA stream cut short, an empty answer or a malformed tool call.
refusalrefusalThe model's refusal.
RuleDetail
on unsetEvery trigger is on.
on is []Every trigger is off. The chain stays set and is never walked.
A trigger that is offThe failure stays on the selected model.
Rate limit, outage, broken answerThe selected model's retries are spent first. Then the round re-runs on the next entry. A status no retry cures moves at once.
Slow startWatched only while a chain entry stands behind the attempt. Past first_token_seconds, 60 unless set, 0 never, the round leaves for the next entry at once, without retrying.
RefusalNever resent. The chain's first entry answers that round. The next round runs on the selected model.
On a chain entryA failure no retry cures, or one whose retries are spent, moves to the next entry, whatever on says.
ScopeOne turn. Its later rounds stay on the entry that answered. 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, as is an on id no trigger has.
No chainNo failover.

When every model fails, the turn's error starts every model failed and lists each model it tried, one a line, with what its provider said: 1. provider/model · HTTP 400: ....

Backup tab

/models, then Tab to Backup. Its rows, top to bottom:

RowDoes
1. MODEL, one per backupTried in order. The detail says its provider, when it last answered and how many chain moves it rescued. Enter takes it out.
Add a backup…Pick a model; it goes last.
Test backupsAsks each backup once, with no retry and no chain.
Switch when the model hitsThe five triggers. Enter turns one on or off.

The tab writes failover.chain and failover.on. The next turn reads them.

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