Home ↗

Models & config

Anturno has no built-in default provider. You add named model entries in user config, then connect and select them in the TUI.

Config shape

Edit ~/.anturno/config.json (user scope only — project config cannot define or select models):

{
  "models": [
    {
      "id": "openai",
      "displayName": "OpenAI",
      "baseUrl": "https://api.openai.com/v1",
      "modelId": "gpt-4.1",
      "apiKey": "${OPENAI_API_KEY}",
      "contextWindowTokens": 128000,
      "inputCostPerMTok": 3,
      "outputCostPerMTok": 15
    }
  ],
  "modelRoles": { "main": "openai" }
}
FieldPurpose
idHow you refer to it: /connect openai, /model openai
baseUrl / modelIdEndpoint and model name
apiKey${ENV_VAR} reference, a literal (local only), or omit and supply later via /connect
contextWindowTokensContext window for compaction and the TUI meter (default 128000)
inputCostPerMTok / outputCostPerMTokOptional; without them /cost shows “cost n/a”

The supported production path speaks the OpenAI Responses API. A custom baseUrl must speak that protocol.

Why user scope only

models and modelRoles are never read from project config. A repo could otherwise redirect model calls through an attacker-controlled endpoint carrying your API key.

Connect → model → cost

  1. /connect <id> <key> stores the key under ~/.anturno/credentials.json (mode 0600).
  2. /model <id> sets the active model for the project.
  3. Turns run against that entry — key resolution order: inline config value → stored credential → named env var.
  4. /cost attributes dollars using the per-MTok rates, when configured.
  5. Resuming a session re-adopts the model it was on.

With an empty models[], first-run tips you to add config instead of showing an empty connect picker.

Derived env key

If you omit apiKey and never run /connect, Anturno also looks for ANTURNO_MODEL_<ID>_API_KEY (uppercase id).