Docs / Autopilot / Models and providers

Models, providers and configuration

Connect a model provider with your own key, run local models with Ollama or LM Studio, and set options in config.json.

How keys are set

Autopilot uses one active provider at a time. Every model call goes to that provider with your key: chat, compaction and memory side-calls, embeddings, the model picker, pricing and error messages. Nothing is sent to OpenRouter while another provider is active.

You can provide a key in three ways:

  1. Environment variable. Each provider has its own variable (see the table below). With a key in the environment, the setup screen does not appear, which is how you run Autopilot in CI, a VM or a container.
  2. Sign-in or setup screen. The first-run screen, /provider inside the UI, or autopilot auth <id> on the command line. The key is checked, then saved to the config file.
  3. Config file. providers.<id>.apiKey in config.json. OpenRouter and Requesty keep their own top-level fields (openrouterApiKey, requestyApiKey).

Environment variables win over the file.

Providers

Provider id Key Notes
OpenRouter (default) openrouter OPENROUTER_API_KEY, or browser sign-in 400+ models, billed cost per turn, sticky routing, subagents, Jev checks
Anthropic anthropic ANTHROPIC_API_KEY Native Messages API with extended or adaptive thinking and explicit prompt caching. API keys only: Claude Pro or Max sign-in isn't permitted for third-party tools.
OpenAI openai OPENAI_API_KEY Responses API; reasoning carries across tool loops; codex models
Google Gemini gemini GEMINI_API_KEY or GOOGLE_API_KEY OpenAI-compatible endpoint; Gemini 3 thought signatures are kept with each tool call
ChatGPT (Plus, Pro, Team) chatgpt autopilot auth chatgpt (browser sign-in) Your plan's GPT models over the Responses API. Tokens refresh automatically. Usage counts against your plan.
GitHub Copilot copilot autopilot auth copilot (GitHub device login; --enterprise <domain>) Your Copilot plan's models. Usage counts as premium requests. Not a documented public API, so GitHub may change it.
Google Vertex AI vertex Google credentials (gcloud auth application-default login, GOOGLE_APPLICATION_CREDENTIALS, or GOOGLE_VERTEX_ACCESS_TOKEN) plus GOOGLE_VERTEX_PROJECT Gemini and partner models, and Claude through Anthropic's Messages API on Vertex. Location from GOOGLE_VERTEX_LOCATION (default global).
Amazon Bedrock bedrock AWS_BEARER_TOKEN_BEDROCK, or AWS credentials (env, ~/.aws/credentials, AWS_PROFILE); region AWS_REGION Converse API with SigV4 signing. Inference-profile ids such as global.anthropic.claude-sonnet-5-5.
DeepSeek deepseek DEEPSEEK_API_KEY
MiniMax minimax MINIMAX_API_KEY <think> tags are separated out if they appear
Moonshot AI (Kimi) moonshot MOONSHOT_API_KEY
Kimi Code (subscription) kimi-code KIMI_API_KEY
Z.ai (GLM) zai ZHIPU_API_KEY
Z.ai GLM Coding Plan zai-coding ZHIPU_API_KEY
xAI xai XAI_API_KEY Grok over the Responses API
Mistral mistral MISTRAL_API_KEY
Groq groq GROQ_API_KEY
Cerebras cerebras CEREBRAS_API_KEY
Together AI together TOGETHER_API_KEY
Fireworks AI fireworks FIREWORKS_API_KEY
DeepInfra deepinfra DEEPINFRA_API_KEY
Vercel AI Gateway vercel AI_GATEWAY_API_KEY Many vendors with one key
Cloudflare Workers AI cloudflare CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID (or autopilot auth cloudflare --account-id <id>) For Cloudflare AI Gateway, use its OpenAI-compatible URL as a custom endpoint
Azure OpenAI azure AZURE_API_KEY and AZURE_RESOURCE_NAME (or autopilot auth azure --resource <name>) Model ids are your deployment names. Entra ID sign-in isn't supported yet.
Ollama (local) ollama none Installed models are discovered
LM Studio (local) lmstudio none Loaded models are discovered
Requesty requesty REQUESTY_API_KEY See Requesty
Any OpenAI-compatible endpoint custom KIMIFLARE_API_KEY (optional) KIMIFLARE_BASE_URL. For LiteLLM, vLLM, llama.cpp or a company gateway.

Switch provider

Where Command
Terminal UI /provider lists providers and where each key comes from. /provider <id> [key] switches.
CLI autopilot auth <id> [key] saves a key and makes the provider active.
CLI autopilot auth use <id> makes an already-connected provider active.
CLI autopilot auth status lists providers, the active one, and where each key comes from.
One run AUTOPILOT_PROVIDER=<id> autopilot

autopilot auth <id> accepts these options where they apply:

Option Applies to Effect
--base-url <url> key-based and local providers Use a different endpoint, for example Ollama on another host
--account-id <id> cloudflare Cloudflare account id
--resource <name> azure Azure OpenAI resource name
--region <region> bedrock AWS region
--project <id>, --location <location> vertex Google Cloud project and Vertex location
--enterprise <domain> copilot GitHub Enterprise domain
--paste, --code openrouter Paste an existing key, or sign in on another device and paste the code OpenRouter shows

Features that need OpenRouter

These switch off on other providers:

  • Billed-cost confirmation. Elsewhere, /cost shows estimates from the provider's published prices.
  • Subagents in Hotcell sandboxes.
  • The Jev completion and message-triage checks.

Embeddings without an embeddings API

Anthropic, DeepSeek, Moonshot, Kimi Code, the Coding Plan and LM Studio have no embeddings API. Memory still works through text and topic-key recall. To keep vector recall, set "embeddingProvider": "openai" (or AUTOPILOT_EMBEDDING_PROVIDER=openai) with that provider's key, or set memoryEmbeddingModel.

Local models

Ollama

Start Ollama, then make it the active provider:

autopilot auth ollama
autopilot

Autopilot checks that it is reachable and discovers your installed models. The default endpoint is http://127.0.0.1:11434/v1. For another host:

autopilot auth ollama --base-url http://gpu-box:11434/v1

Or set it in the config file:

{
  "provider": "ollama",
  "providers": {
    "ollama": { "baseUrl": "http://gpu-box:11434/v1" }
  }
}

LM Studio

autopilot auth lmstudio

The default endpoint is http://127.0.0.1:1234/v1. Use --base-url for another host.

Choose a model

Pick a model on first run, or switch with /model. Each provider shows its own catalog: OpenRouter's live catalog, models.dev for other hosted providers, and live discovery for Ollama and LM Studio.

/model                          # open the picker
/model list [filter]            # list models
/model anthropic/claude-sonnet-5
autopilot -m moonshotai/kimi-k2.7-code -p "..."

On OpenRouter, any model id works, including variants such as :free and :nitro. Models listed without tool calling are hidden from the picker. A key with no credits can still use OpenRouter's free models (ids ending in :free), subject to OpenRouter's daily request cap.

OpenRouter key and credit

/key shows which key is in use. On OpenRouter it also shows what the key has spent and how much credit is left. /key set <key> replaces it and /key clear removes it.

You can also connect from the CLI:

autopilot auth openrouter            # browser sign-in
autopilot auth openrouter --paste    # paste an existing key
autopilot auth openrouter sk-or-...  # save a key directly

Over SSH or in a container, sign-in shows a link to open on any device and asks for the code OpenRouter displays.

OpenRouter provider routing

OpenRouter serves most models through several upstream providers. Autopilot always requires upstream providers that support every parameter it sends. To steer routing further, add openrouterProvider with any of OpenRouter's provider preferences:

{ "openrouterProvider": { "ignore": ["SomeProvider"], "data_collection": "deny" } }

Avoid order and sort unless you need them. They turn off sticky routing, which keeps the prompt cache warm.

Custom gateway endpoint

Point every model call at your own OpenAI-compatible endpoint:

export KIMIFLARE_BASE_URL="https://your-broker.example.com/v1"  # /chat/completions is appended
export KIMIFLARE_API_KEY="<bearer for that endpoint>"           # optional
autopilot -p "..."

The same pair can be saved in the config file as baseUrl and apiKey. Environment variables win, field by field. With a base URL set:

  • Chat requests go to <baseUrl>/chat/completions and memory embeddings to <baseUrl>/embeddings.
  • Authorization: Bearer $KIMIFLARE_API_KEY is sent. With no key set, no Authorization header is sent.
  • Model ids pass through unchanged. Your endpoint owns provider dispatch.
  • Cost is a local estimate only.

Requesty

Requesty is another OpenAI-compatible gateway. It is only used when no OpenRouter key and no custom endpoint are configured.

export REQUESTY_API_KEY="<your key>"
autopilot                 # or: autopilot auth requesty
  • The key can also be saved as requestyApiKey in the config file. The environment variable wins.
  • REQUESTY_BASE_URL picks a region, for example https://router.eu.requesty.ai/v1. Only https URLs on Requesty's hosts are accepted.
  • Defaults on Requesty: kimi-k2.6 for the main model, deepseek-v4-flash for side calls, and openai/text-embedding-3-small for memory embeddings.

Config file

The config file is ~/.config/kimiflare/config.json. If XDG_CONFIG_HOME is set, it is $XDG_CONFIG_HOME/kimiflare/config.json. Autopilot writes it with mode 600. The kimiflare path is kept for compatibility with earlier versions.

{
  "provider": "deepseek",
  "providers": {
    "deepseek": { "apiKey": "sk-...", "model": "deepseek-v4-pro" },
    "ollama": { "baseUrl": "http://gpu-box:11434/v1" }
  }
}

Hooks are configured in separate settings.json files. See Hooks.

Config keys

Key Type Default Env override Description
provider string inferred from credentials AUTOPILOT_PROVIDER Active provider id
providers object Per-provider apiKey, baseUrl and model, keyed by provider id
openrouterApiKey string OPENROUTER_API_KEY, KIMIFLARE_OPENROUTER_KEY OpenRouter key
requestyApiKey string REQUESTY_API_KEY Requesty key
model string provider's default KIMI_MODEL Chat model id
openrouterProvider object OpenRouter provider-routing preferences
baseUrl string KIMIFLARE_BASE_URL Custom OpenAI-compatible endpoint
apiKey string KIMIFLARE_API_KEY Bearer for baseUrl
reasoningEffort low, medium, high medium KIMI_REASONING_EFFORT Reasoning effort
modesEnabled boolean false Turn on plan, edit and auto modes. See Modes.
permissions object Per-tool permission rules for headless runs
subagentPolicy off, suggest, auto auto KIMIFLARE_SUBAGENT_POLICY Subagent delegation policy
workerMaxParallel number 3 KIMIFLARE_WORKER_MAX_PARALLEL Subagents running at once
workerTimeoutMs number 600000 KIMIFLARE_WORKER_TIMEOUT_MS Subagent research timeout
completionCheck boolean true KIMIFLARE_COMPLETION_CHECK End-of-turn "did it finish?" check (OpenRouter only)
codeMode boolean true KIMIFLARE_CODE_MODE Present tools as a TypeScript API run in a sandbox
memoryEnabled boolean false KIMIFLARE_MEMORY_ENABLED Local structured memory
memoryDbPath string .kimiflare/memory.db in the repo root KIMIFLARE_MEMORY_DB_PATH Memory database path
memoryMaxAgeDays number 90 KIMIFLARE_MEMORY_MAX_AGE_DAYS Memory age before cleanup
memoryMaxEntries number 1000 KIMIFLARE_MEMORY_MAX_ENTRIES Memories per repository
memoryEmbeddingModel string provider's embedding model KIMIFLARE_MEMORY_EMBEDDING_MODEL Embedding model for memory and skills
embeddingProvider provider id active provider AUTOPILOT_EMBEDDING_PROVIDER Provider for embeddings
plumbingModel string provider's side-call model KIMIFLARE_PLUMBING_MODEL Model for internal side calls
costAttribution boolean true KIMI_COST_ATTRIBUTION Cost attribution by task type
filePicker boolean true KIMIFLARE_FILE_PICKER @ file mention picker
shell string auto KIMIFLARE_SHELL Shell for the bash tool: auto, bash, cmd, powershell or an absolute path
mcpServers object MCP servers. See MCP servers.
lspEnabled boolean off Language Server Protocol integration
lspServers object Language server definitions
preferPullRequests boolean true KIMIFLARE_PREFER_PULL_REQUESTS Tell the model to prefer pull requests over direct pushes
allowDirectPush boolean false KIMIFLARE_ALLOW_DIRECT_PUSH Allow git push to the default branch from the bash tool
maxTotalToolIterations number 1000 KIMIFLARE_MAX_TOTAL_TOOL_ITERATIONS Hard ceiling on tool iterations per turn
imageMaxEdge number 1568 KIMIFLARE_IMAGE_MAX_EDGE Long edge (px) attached images are downscaled to. 0 sends them unchanged.
imageQuality number 75 KIMIFLARE_IMAGE_QUALITY JPEG quality for re-encoded images
trace object off KIMIFLARE_TRACE, KIMIFLARE_TRACE_DIR { "enabled": true, "root": "<dir>" }. See Session traces.
runNotifications object AUTOPILOT_NOTIFY_EMAIL_TO, AUTOPILOT_NOTIFY_EMAIL_FROM Email about unattended runs. See Running unattended.
maxConcurrentRuns number 4 AUTOPILOT_MAX_CONCURRENT_RUNS Unattended runs doing work at once

The full type, with comments, is KimiConfig in src/config.ts.

MCP servers

MCP servers are defined under mcpServers. Each entry is either a local command or a remote URL:

Field Type Description
type local or remote How to connect
command string array Command and arguments for a local server
url string URL of a remote server
env object Environment for a local server
headers object HTTP headers for a remote server
enabled boolean Set false to skip the server
timeoutMs number Per-call timeout. Default 60000.

Inside the UI, /mcp list shows connected servers and their tools, and /mcp reload reconnects them. MCP tool names start with mcp_.

Language servers

Turn on LSP with lspEnabled and define servers under lspServers, or use /lsp config in the UI. Each server takes command (string array), and optionally env, enabled, rootPatterns, timeoutMs (default 10000) and maxRestartAttempts (default 3). A project can ship its own servers in .kimiflare/lsp.json; they only start after you trust the project.