All use cases
Editor tools
OpenRouter free models in OpenCode and Cline
Any tool with an OpenAI-compatible provider can use free models through one base URL. Set the key and a :free model id, and the tool needs no other setup.
What this is for
Each editor tool wants its own provider, key and model list. Free models change often, so the setup you copied last month points at a model that is gone.
How the request flows
Cline or OpenCodeOpenAI API
AnyRouterone base URL
Free modela :free id
Steps, then copy
- 1.Create an AnyRouter key under Dashboard → Keys. It starts with sk-ar-.
- 2.In the tool, add an OpenAI-compatible provider with the base URL and your key, and set the model to a :free id such as google/gemma-4-26b-a4b-it:free.
- 3.Prefer a model that AnyRouter picks for you? Use anyrouter/free instead. If a :free model has no route left, AnyRouter answers through anyrouter/free.
Cline · OpenAI Compatible
text
API Provider: OpenAI Compatible
Base URL: https://anyrouter.dev/api/v1
API Key: sk-ar-...
Model: google/gemma-4-26b-a4b-it:freeopencode.json
json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"anyrouter": {
"npm": "@ai-sdk/openai-compatible",
"name": "AnyRouter",
"options": {
"baseURL": "https://anyrouter.dev/api/v1",
"apiKey": "{env:ANYROUTER_API_KEY}"
},
"models": {
"google/gemma-4-26b-a4b-it:free": { "name": "Gemma 4 26B (free)" }
}
}
},
"model": "anyrouter/google/gemma-4-26b-a4b-it:free"
}Limits
- Coding agents call tools. Pick a model that supports tool calling; free models vary.
- Free models have smaller context windows and shorter answers than paid ones. Check the model page.
- Free requests allow 2400 a minute per API key and have no daily cap. A busy free route can still be slow.
- When a :free model falls back, a different free model answers. Check the model field if you need one exact model.
Ready to try it
The guide has the full walkthrough. Sign up if you still need a key.
Next playbooks
- OpenRouter free models, with fallback to another free modelCall a :free model by id. If its routes are rate limited or down, AnyRouter answers through anyrouter/free instead, with a different free model, and tells you which one.
- Run OpenCode through AnyRouterOne CLI command injects an AnyRouter provider for the session, or add a custom provider in opencode.json — one key, the Chat Completions catalog, and request logs.
- Run every coding agent through one URLClaude Code, Codex, OpenCode, Cursor, and other OpenAI-compatible tools share 256+ models, one balance, and one request log.