English Arabic 简体中文 繁體中文 Français Deutsch 日本語 한국어 Português Русский Español
No other translations yet

Anthropic API Model Names: Claude Model IDs Explained

Anthropic API Model Names: Claude Model IDs Explained

If an Anthropic API request fails with an invalid model error, the problem is often the string in the model field—not your prompt. Anthropic uses human-readable Claude names for product pages, dated model IDs for reproducible API calls, and aliases for convenient upgrades. Those values are related, but they are not interchangeable.

The practical rule is simple: use an exact model ID when you need repeatable behavior, use an alias when you intentionally want Anthropic to move you to a newer snapshot, and never copy a marketing name into an API request without checking the official model list first.

What is an Anthropic API model name?

An Anthropic API model name is the identifier sent in the model parameter of a request to the Messages API. It tells Anthropic which Claude family and snapshot should process the request.

These three forms are easy to confuse:

Value typeExampleBest use
Display nameClaude SonnetDocumentation, product UI, conversations with non-technical readers
Current model IDclaude-sonnet-5New integrations using a model listed on Anthropic’s current models page
Dated model IDclaude-haiku-4-5-20251001Tests, regulated workflows, evaluations, and production rollouts that require reproducibility

The exact catalog changes over time. Treat Anthropic’s current models page and model deprecations page as the source of truth instead of hard-coding a list copied from an old tutorial.

Claude model names versus Claude model IDs

Claude model names are optimized for people. “Claude Sonnet” communicates the product tier, while “Claude Haiku” suggests the faster, lower-cost tier. The API needs a more precise value because a family can have multiple snapshots, regional availability rules, and retirement dates.

A dated ID usually includes:

  1. The Claude family, such as opus, sonnet, or haiku.
  2. The major model generation.
  3. A release date in YYYYMMDD form.

For example, claude-haiku-4-5-20251001 identifies the Haiku 4.5 snapshot released on October 1, 2025. The date is part of the identifier; it is not a request timestamp and should not be replaced with the current date.

Some model catalogs also expose shorter family-level identifiers. They are convenient when you want a supported model without managing a dated snapshot yourself. The tradeoff is that a provider-managed pointer may change behavior after an update, so verify the semantics of the exact ID shown in Anthropic’s current catalog.

Common Claude model IDs you may encounter

The following API IDs were listed as active on Anthropic’s current models page on July 24, 2026. This table is a point-in-time orientation, not a permanent registry. Check Anthropic’s documentation before using any ID in a new deployment.

Claude familyCurrent API IDTypical role
Claude Opus 4.8claude-opus-4-8Complex reasoning and high-stakes analysis
Claude Sonnet 5claude-sonnet-5General-purpose production workloads
Claude Haiku 4.5claude-haiku-4-5-20251001Fast classification, extraction, and short responses
Claude Opus 4.7claude-opus-4-7Recent-generation Opus integrations that have not moved to 4.8
Claude Sonnet 4.6claude-sonnet-4-6Recent-generation Sonnet integrations that have not moved to Sonnet 5

These are identifiers, not guarantees that a model is available on every Anthropic account. Even a currently listed ID can fail because of account permissions, region, quota, or a later lifecycle change. Dated IDs are reproducible while supported, but they are still retired eventually.

How to choose between Opus, Sonnet, and Haiku

Choose by workload rather than by the longest name:

  • Opus: Use when difficult reasoning, long-form synthesis, or nuanced tool decisions justify higher latency or cost.
  • Sonnet: Start here for most production assistants, coding workflows, and structured generation. It is usually the practical quality-to-latency baseline.
  • Haiku: Use for high-volume routing, extraction, moderation, short rewrites, and other tasks where response time matters more than maximum reasoning depth.

Run a small evaluation against representative prompts before switching families. Include malformed inputs, long context, tool calls, JSON output, and the fallback behavior your application uses when a request fails. A model name that looks like a drop-in replacement may still change tool-call formatting or edge-case behavior.

Use the model ID in a Messages API request

The model value belongs in the JSON body. It is separate from the API version header and from the model shown in the Claude web app.

curl https://api.anthropic.com/v1/messages \
  --header "x-api-key: $ANTHROPIC_API_KEY" \
  --header "anthropic-version: 2023-06-01" \
  --header "content-type: application/json" \
  --data '{
    "model": "claude-sonnet-5",
    "max_tokens": 512,
    "messages": [
      {
        "role": "user",
        "content": "Explain why API model IDs should be pinned in production."
      }
    ]
  }'

The anthropic-version header describes the API contract. It does not select the Claude model. Keep those two settings independent in your configuration so a client-library upgrade does not silently change model routing.

For SDK usage, set the same identifier through the client’s message-creation method and keep it in an environment-specific configuration value. Do not put an API key or a model ID in a browser bundle; server-side routing is easier to secure and test.

Why an API model ID can stop working

An invalid_request_error or “model not found” response usually falls into one of these categories:

The display name was used instead of the ID

Claude Sonnet is a useful label but not a reliable request value. Replace it with an ID or alias listed in the provider documentation.

The snapshot was deprecated

Dated IDs are reproducible only while the provider supports them. Monitor the deprecation schedule, set a migration deadline, and test the replacement before the retirement date.

The account cannot access the model

A valid identifier can still be unavailable because of account permissions, region, quota, or an organization policy. Check the response body and account configuration rather than changing the prompt.

The router expects a provider-specific name

Gateways and OpenAI-compatible APIs may normalize model names differently. Anthropic currently documents claude-sonnet-5, while another provider may expose a namespaced value or a provider-owned alias. Use the gateway’s model catalog and do not assume that a Claude ID is portable across every endpoint.

Using Claude-style workflows through a compatible endpoint

If your application already uses the OpenAI client shape, a compatibility layer can reduce migration work. Novita LLM API provides an OpenAI-compatible endpoint for routing supported open-source models through a familiar chat-completions request shape.

That does not mean every Claude model ID is automatically available there. Keep provider routing explicit:

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["NOVITA_API_KEY"],
    base_url="https://api.novita.ai/v3/openai",
)

response = client.chat.completions.create(
    model="moonshotai/kimi-k2.5",
    messages=[
        {"role": "user", "content": "Summarize this support ticket in three bullets."}
    ],
)

print(response.choices[0].message.content)

The important design pattern is a provider/model map, not a single global string:

MODELS = {
    "anthropic": "claude-sonnet-5",
    "novita": "moonshotai/kimi-k2.5",
}

This lets you evaluate a Claude model against an open-source alternative without rewriting business logic. Before switching, compare structured output, tool calls, context handling, latency, and failure modes—not only the display name or benchmark headline.

Model IDs in agent backends and sandboxes

An agent usually calls a model many times: planning, tool selection, code repair, and final response. Put the model identifier in the backend configuration, not in user-controlled tool arguments. Log the selected provider and model ID with each run so an evaluation can be reproduced later.

When an agent executes generated code, keep model routing separate from the execution environment. A managed Agent Sandbox can isolate files, packages, and commands, while the LLM API configuration remains in the agent service. This separation makes it possible to change a model alias or test a pinned snapshot without changing the sandbox image.

For production agents, add three safeguards:

  1. Validate the configured model at startup with a small authenticated request or provider catalog check.
  2. Keep a tested fallback ID and make fallback activation visible in telemetry.
  3. Store the model ID, API version, prompt version, and tool schema with evaluation results.

FAQ

What is the correct Claude model name for the API?

Use the exact model ID listed in Anthropic’s current documentation, such as claude-sonnet-5 or the dated claude-haiku-4-5-20251001. Do not use a display name like “Claude Sonnet” by itself.

Is a dated Claude model ID better than an alias?

Neither is always better. A dated ID is preferable for reproducibility and controlled rollouts. An alias is preferable when you want a maintained family pointer and have regression tests for provider updates.

Can I use Anthropic model IDs with an OpenAI-compatible API?

Only if that endpoint explicitly supports and documents the ID. OpenAI-compatible describes the request interface; it does not promise identical model catalogs. Check the endpoint’s supported models and use its exact routing name.

How do I prevent a model deprecation from breaking my app?

Pin a tested ID, monitor Anthropic’s deprecation notices, test the replacement before the retirement date, and keep the model value in configuration so you can change it without shipping business-logic changes.

Sources