# 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.

- Date: 2026-09-30
- HTML: https://anyrouter.dev/blog/releases/2026-09-30-latest-aliases

## Notes

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](https://anyrouter.dev/docs/features/latest-model-aliases).

- App code: [Vercel AI SDK](https://anyrouter.dev/use-cases/ai-sdk) or [OpenAI SDK](https://anyrouter.dev/use-cases/openai-sdk).
- Coding agent: `anyr claude` / `anyr opencode` / `anyr codex` ([playbook](https://anyrouter.dev/use-cases/coding-agents)).
- No code: [playground](https://anyrouter.dev/playground?model=google/gemini-flash-latest).

Try it in the [Vercel AI SDK](https://anyrouter.dev/use-cases/ai-sdk). `createAnyRouter()` reads `ANYROUTER_API_KEY`:

```ts
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](https://anyrouter.dev/use-cases/openai-sdk):

### OpenAI SDK

```ts
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

```bash
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:

### Claude Code

```bash
curl -fsSL https://anyrouter.dev/cli.sh | bash
anyr login
anyr claude --model "anthropic/claude-sonnet-latest"
```

### OpenCode

```bash
curl -fsSL https://anyrouter.dev/cli.sh | bash
anyr login
anyr opencode --model "deepseek/deepseek-latest"
```

### Codex

```bash
curl -fsSL https://anyrouter.dev/cli.sh | bash
anyr login
anyr codex --model "openai/gpt-latest"
```

More: [AI SDK](https://anyrouter.dev/use-cases/ai-sdk) · [OpenAI SDK](https://anyrouter.dev/use-cases/openai-sdk) · [coding agents](https://anyrouter.dev/use-cases/coding-agents).

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

[Try in playground](https://anyrouter.dev/playground?model=google/gemini-flash-latest)
