Pinned ids break
If your code pins google/gemini-3.5-flash, you edit it every time a newer Flash ships, and it breaks the day that model is retired or goes down.
A latest alias names the family instead. Send google/gemini-flash-latest and AnyRouter calls the newest Gemini Flash model that can serve your request right now. If it is unavailable, AnyRouter tries the next newest model in the family automatically.
What you see and pay
The response model field is the concrete model that answered, for example google/gemini-3.8-flash, so logs and evals stay honest. Billing uses that model's price.
There are 19 aliases: google/gemini-flash-latest, google/gemini-flash-lite-latest, google/gemini-pro-latest, google/gemma-latest, deepseek/deepseek-latest, deepseek/deepseek-flash-latest, anthropic/claude-opus-latest, anthropic/claude-sonnet-latest, anthropic/claude-haiku-latest, openai/gpt-latest, openai/gpt-mini-latest, openai/gpt-nano-latest, qwen/qwen-max-latest, qwen/qwen-plus-latest, qwen/qwen-flash-latest, z-ai/glm-latest, z-ai/glm-flash-latest, moonshotai/kimi-latest and x-ai/grok-latest.
An alias can move to a newer model without notice, which may change output style, price, or supported parameters. Pin a concrete id for workloads that need stable behavior. A models fallback list you send yourself takes precedence.
Try it
import { createAnyRouter } from "@anyr/ai-sdk-provider"
import { generateText } from "ai"
const anyrouter = createAnyRouter()
const { text, response } = await generateText({
model: anyrouter("anthropic/claude-sonnet-latest"),
prompt: "Summarize this diff in three bullets.",
})
console.log(text, response.modelId)curl -fsSL https://anyrouter.dev/setup.sh | bash
anyr login
anyr claude --model "anthropic/claude-sonnet-latest"- Release note — the canonical launch note.
- Docs — how aliases resolve.
- Vercel AI SDK, OpenAI SDK and coding agents.
No terminal? Open the playground and send a first message.
Try in playgroundRelated posts
Use AnyRouter with the Vercel AI SDK
@anyr/ai-sdk-provider wraps the AnyRouter gateway as a standard Vercel AI SDK provider. Call createAnyRouter(), pass a provider/model id, and generateText, streamText, and generateObject work unchanged — switching models is a one-string edit.
Run coding agents through one gateway
Point Claude Code, Codex, OpenCode, Cursor, or any OpenAI-compatible tool at AnyRouter and get one key for every model, unified billing, per-request audit logs, and app attribution. Two environment variables — or one npx command with the anyr CLI launcher.
Use the OpenAI SDK with any model
The official openai package for Python and TypeScript doesn't have to mean OpenAI models. Override base_url and api_key, keep every other call the same, and address 170+ models across 28+ providers as provider/model strings — including OpenAI's own.
Route your first request in 2 minutes
Start free with your own keys, or top up and pay per token. Get $4/mo in credits and free models on Go — $2/mo, or free when you donate a provider key.
Start free