OpenRouter

August 28, 2026 · View on GitHub

Single API key, many open-weight models. agents-cli ships built-in OpenRouter presets so adding the second profile never re-prompts for a key.

Quick start

agents harness create
# pick openrouter, fill prompts, run smoke test
agents run my-profile "hello"

Or use the built-in presets directly:

agents accounts add openrouter --provider openrouter --auth api-key   # store key once
agents harness add kimi                 # reasoning model, interactive
agents harness add kimi-chat            # non-reasoning sibling, print-safe
agents run kimi-chat --print "summarize the diff"

Required values

VarWhere to get it
API keyhttps://openrouter.ai/keys
Model idhttps://openrouter.ai/models<vendor>/<model-slug>

Generated profile shape

name: my-profile
host: { agent: claude }
env:
  # static vars (always set):
  ANTHROPIC_BASE_URL: https://openrouter.ai/api/v1
  # vars wizard collects:
  ANTHROPIC_MODEL: moonshotai/kimi-k2-0905
  ANTHROPIC_SMALL_FAST_MODEL: moonshotai/kimi-k2-0905
auth:
  envVar: ANTHROPIC_AUTH_TOKEN
  keychainItem: agents-cli.openrouter.token

Built-in presets

PresetModelNotes
kimimoonshotai/kimi-k2.5Reasoning — interactive only.
kimi-chatmoonshotai/kimi-k2-0905Non-reasoning sibling. Print-safe.
minimaxminimax/minimax-m2.5Reasoning — interactive only.
glmz-ai/glm-5Reasoning — interactive only.
qwenqwen/qwen3-coder-nextLatest coding Qwen. Print-safe.
deepseekdeepseek/deepseek-chat-v3-0324Non-reasoning DeepSeek Chat. Print-safe.

Known caveats

Print-safe vs reasoning models. Claude Code's --print consolidator returns empty stdout when the response contains thinking or redacted_thinking blocks. That's why running a reasoning model (kimi, minimax, glm) under agents run --print looks "silent" — the model is replying, but its top-level blocks are reasoning, and the consolidator strips them.

The fix: use kimi-chat (non-reasoning) for scripting and pipelines, and kimi (reasoning) for interactive use. The same rule applies to any reasoning model you wire up manually — if --print returns empty, switch to a non-reasoning sibling.

Troubleshooting

SymptomCauseFix
agents run kimi --print "..." prints nothingReasoning model; --print consolidator drops thinking blocksUse kimi-chat (or any print-safe preset) for scripted use
401 / Invalid API keyStale or wrong key in Keychainagents accounts set-key openrouter to rotate
model not foundSlug typo or model retiredLook up the current slug at openrouter.ai/models
429 / rate limitOpenRouter per-key capAdd credits or slow down