Skip to content
All releases
Added

Latest aliases: name a model family, always get a live model

Send google/gemini-flash-latest, anthropic/claude-sonnet-latest and 17 other -latest ids. AnyRouter calls the newest model in that family that is available right now, skips retired ones, and bills the model that answered.

Models get retired or go down, and a pinned id breaks when they do. A -latest alias names a family instead. AnyRouter calls the newest model in that family that can serve your request right now, and if it is unavailable it moves on to the next newest one.

The response model field tells you which concrete model answered (for example google/gemini-3.8-flash), and you are billed at that model's price. There are 19 aliases at launch:

  • Google — google/gemini-flash-latest, google/gemini-flash-lite-latest, google/gemini-pro-latest, google/gemma-latest.
  • DeepSeek — deepseek/deepseek-latest, deepseek/deepseek-flash-latest.
  • Anthropic — anthropic/claude-opus-latest, anthropic/claude-sonnet-latest, anthropic/claude-haiku-latest.
  • OpenAI — openai/gpt-latest, openai/gpt-mini-latest, openai/gpt-nano-latest.
  • Qwen — qwen/qwen-max-latest, qwen/qwen-plus-latest, qwen/qwen-flash-latest.
  • Z.ai — z-ai/glm-latest, z-ai/glm-flash-latest.
  • Moonshot AI — moonshotai/kimi-latest. xAI — x-ai/grok-latest.

Aliases can move to a newer model without notice, which may change output style, pricing, or supported parameters. Pin a concrete id when you need stable behavior. If you send your own models fallback list, AnyRouter uses yours. See the docs.

Try it in the Vercel AI SDK. createAnyRouter() reads ANYROUTER_API_KEY:

import { createAnyRouter } from "@anyr/ai-sdk-provider"
import { generateText } from "ai"

const anyrouter = createAnyRouter()

const { text, response } = await generateText({
  model: anyrouter("google/gemini-flash-latest"),
  prompt: "Summarize this diff in three bullets.",
})
console.log(text)
console.log(response.modelId) // the concrete model that answered
generateText with a latest alias.

Already on the OpenAI SDK? OpenAI SDK playbook:

OpenAI-compatible: SDK or curl.
import OpenAI from "openai"

const client = new OpenAI({
  baseURL: "https://anyrouter.dev/api/v1",
  apiKey: process.env.ANYROUTER_API_KEY,
})

const res = await client.chat.completions.create({
  model: "anthropic/claude-sonnet-latest",
  messages: [{ role: "user", content: "Hello" }],
})
console.log(res.model) // the concrete model that answered
console.log(res.choices[0]?.message.content)
curl https://anyrouter.dev/api/v1/chat/completions \
  -H "Authorization: Bearer $ANYROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"anthropic/claude-sonnet-latest","messages":[{"role":"user","content":"Hello"}]}'

Or launch a coding agent through the anyr CLI:

Coding agents via the AnyRouter CLI.
curl -fsSL https://anyrouter.dev/setup.sh | bash
anyr login
anyr claude --model "anthropic/claude-sonnet-latest"
curl -fsSL https://anyrouter.dev/setup.sh | bash
anyr login
anyr opencode --model "deepseek/deepseek-latest"
curl -fsSL https://anyrouter.dev/setup.sh | bash
anyr login
anyr codex --model "openai/gpt-latest"

More: AI SDK · OpenAI SDK · coding agents.

No terminal? Open the playground and send a first message.

Try in playground
Looking for the full catalog? Browse all models.