Docs · Provider

OpenRouter in Claude Code, Codex, Gemini CLI and OpenCode

OpenRouter sells many vendors’ models behind one key and serves them on OpenAI Chat Completions and Anthropic Messages. Add the key to packinggoods once, and Claude Code, Codex, Gemini CLI, OpenCode and every other agent you connect can use any OpenRouter model through packinggoods’s gateway at 127.0.0.1:3425, each agent on a model of its own.

Add OpenRouter

  1. Get a keyMake one on openrouter.ai/keys.
  2. Add the providerIn packinggoods’s Providers tab, press + Add provider, pick OpenRouter, paste the key and save. packinggoods asks OpenRouter which models it serves.
  3. Pick it for an agentIn the Agents tab, click the model on the agent’s row and choose an OpenRouter model such as anthropic/claude-opus-5.5.
Terminal
packinggoods provider add openrouter sk-…
packinggoods provider test openrouter

Model ids in packinggoods are provider/model, so OpenRouter’s read openrouter/anthropic/claude-opus-5.5: the provider, then OpenRouter’s own id. The key is kept in packinggoods’s settings; packinggoods doesn’t take it from your shell.

OpenRouter documents two optional headers that credit an app in its rankings, HTTP-Referer and X-OpenRouter-Title. packinggoods doesn’t send them. The provider editor’s Headers field offers them if you want your requests credited.

Endpoints

APIBase URLUsed for
Chat Completionshttps://openrouter.ai/api/v1the model list, requests to non-Claude models, image models
Anthropic Messageshttps://openrouter.ai/apiClaude Code’s requests, and Claude models from any agent
Decisionshttps://openrouter.ai/api/v1decision models for intent routing

packinggoods doesn’t use OpenRouter’s Responses API. An agent that speaks Responses, such as Codex, is translated to one of the two above.

Model list

Terminal
packinggoods provider models openrouter +anthropic/claude-opus-5.5   # expose one more
packinggoods provider models openrouter best                          # newest of each family
packinggoods provider auto-include openrouter '*:free'               # every free model, now and later
packinggoods provider refresh-every openrouter 1d

In each agent

Pick the model on an agent’s row in the Agents tab, or from a terminal. Each guide says what packinggoods writes in that agent’s config and how to switch back.

Terminal
packinggoods claude openrouter/anthropic/claude-opus-5.5
packinggoods codex openrouter/anthropic/claude-opus-5.5
packinggoods gemini model openrouter/google/gemini-3-pro
packinggoods opencode openrouter/anthropic/claude-opus-5.5

If OpenRouter says a model isn’t served on the endpoint packinggoods chose, packinggoods builds the request again for the other one and remembers that for the model.

Reasoning

Cache, cost and credits

Several keys and free models

One OpenRouter provider can hold several keys: press Add another key under it, or paste several at once. Requests go to the first key that’s on, and when it runs out or is rate limited the next one takes over. The provider’s routing can also rotate, weight or drain them instead. Adding the preset again makes a second OpenRouter provider; to spread requests over several keys, add them all to the one provider.

Terminal
packinggoods provider rpm openrouter 20
packinggoods provider spend-cap openrouter <key> 20 month
packinggoods provider fallback openrouter deepseek/deepseek-v4-pro
packinggoods group add my-free-pool models='openrouter/*:free' routing=order
packinggoods group set opus-anywhere stays=session models+=openrouter/anthropic/claude-opus-5.5

Troubleshooting

Vercel AI Gateway in Claude Code, Codex and other agents

API relays in Claude Code, Codex and other agents

FAQ

How do I use OpenRouter in Claude Code?

Add your OpenRouter key in packinggoods (Providers, Add provider, OpenRouter), then pick a model such as anthropic/claude-opus-5.5 on Claude Code’s row, or run packinggoods claude openrouter/anthropic/claude-opus-5.5. packinggoods writes Claude Code’s settings.json and passes its requests on to OpenRouter’s Anthropic endpoint as they are.

Can Codex use OpenRouter models?

Yes. Codex speaks only the Responses API, which packinggoods doesn’t use at OpenRouter. packinggoods translates each Codex request: a Claude model goes to OpenRouter’s Anthropic endpoint and every other model to Chat Completions, and the reply comes back to Codex as Responses.

Can Gemini CLI and OpenCode use OpenRouter?

Yes. Gemini CLI’s requests are translated the same way as Codex’s. OpenCode speaks Chat Completions, so its requests go to OpenRouter as they are, except for Claude models, which packinggoods sends to the Anthropic endpoint so the prompt cache works.

How do I use only OpenRouter’s free models?

Make a routing group from the pattern openrouter/*:free, for example packinggoods group add my-free-pool models='openrouter/*:free' routing=order. It takes every free model OpenRouter lists, including ones it lists later. Models priced at $0 show free in packinggoods’s pickers.

Why do OpenRouter’s free models answer 429?

OpenRouter’s free models take 20 requests a minute. Set packinggoods provider rpm openrouter 20 and packinggoods holds requests back to that rate. When the 429 comes from the shared pool of the provider serving one free model, packinggoods rests only that model and keeps the other free models in use.

Does packinggoods show my OpenRouter credits?

Yes. packinggoods reads OpenRouter’s credits endpoint and shows what is left in dollars: total credits less total usage. The figure is for the whole account, so every key of one account shows the same.

Why does packinggoods fetch OpenRouter’s model list from /api/v1?

Asked at the Anthropic base, OpenRouter answers with its catalog under anthropic/ names it doesn’t serve. packinggoods fetches the list from the Chat Completions base, https://openrouter.ai/api/v1, and a provider given only OpenRouter’s Anthropic base is told to add that Chat base.

By provider: DeepSeek · Kimi and Kimi Code · GLM Coding Plan · Volcengine Ark · Tencent Cloud · Baidu Qianfan · SiliconFlow · ModelScope · Huawei Cloud MaaS · Xiaomi MiMo · StepFun · LongCat · Qwen · MiniMax · Anthropic · OpenAI · Gemini · Grok · Mistral · GitHub Copilot · Ollama

Every agent: Models in Claude Code, Models in Codex, Models in Gemini CLI, Models in OpenCode. Ask on Discord if you get stuck.