Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build LLM-powered apps with the Anthropic Claude API or SDK across Python, TypeScript, Java, Go, Ruby, C#, and PHP.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
shared/models.md
1# Claude Model Catalog23**Only use exact model IDs listed in this file.** Never guess or construct model IDs — incorrect IDs will cause API errors. Use aliases wherever available. For the latest information, WebFetch the Models Overview URL in `shared/live-sources.md`, or query the Models API directly (see Programmatic Model Discovery below).45## Programmatic Model Discovery67For **live** capability data — context window, max output tokens, feature support (thinking, vision, effort, structured outputs, etc.) — query the Models API instead of relying on the cached tables below. Use this when the user asks "what's the context window for X", "does model X support vision/thinking/effort", "which models support feature Y", or wants to select a model by capability at runtime.89```python10m = client.models.retrieve("claude-opus-4-8")11m.id # "claude-opus-4-8"12m.display_name # "Claude Opus 4.8"13m.max_input_tokens # context window (int)14m.max_tokens # max output tokens (int)1516# capabilities is an untyped nested dict — bracket access, check ["supported"] at the leaf17caps = m.capabilities18caps["image_input"]["supported"] # vision19caps["thinking"]["types"]["adaptive"]["supported"] # adaptive thinking20caps["effort"]["max"]["supported"] # effort: max (also low/medium/high)21caps["structured_outputs"]["supported"]22caps["context_management"]["compact_20260112"]["supported"]2324# filter across all models — iterate the page object directly (auto-paginates); do NOT use .data25[m for m in client.models.list()26if m.capabilities["thinking"]["types"]["adaptive"]["supported"]27and m.max_input_tokens >= 200_000]28```2930Top-level fields (`id`, `display_name`, `max_input_tokens`, `max_tokens`) are typed attributes. `capabilities` is a dict — use bracket access, not attribute access. The API returns the full capability tree for every model with `supported: true/false` at each leaf, so bracket chains are safe without `.get()` guards. TypeScript SDK: same method names, also auto-paginates on iteration.3132### Raw HTTP3334```bash35curl https://api.anthropic.com/v1/models/claude-opus-4-8 \36-H "x-api-key: $ANTHROPIC_API_KEY" \37-H "anthropic-version: 2023-06-01"38```3940```json41{42"id": "claude-opus-4-8",43"display_name": "Claude Opus 4.8",44"max_input_tokens": 1000000,45"max_tokens": 128000,46"capabilities": {47"image_input": {"supported": true},48"structured_outputs": {"supported": true},49"thinking": {"supported": true, "types": {"enabled": {"supported": false}, "adaptive": {"supported": true}}},50"effort": {"supported": true, "low": {"supported": true}, …, "max": {"supported": true}},51…52}53}54```5556## Current Models (recommended)5758| Friendly Name | Alias (use this) | Full ID | Context | Max Output | Status |59|-------------------|---------------------|-------------------------------|----------------|------------|--------|60| Claude Opus 4.8 | `claude-opus-4-8` | — | 1M | 128K | Active |61| Claude Opus 4.7 | `claude-opus-4-7` | — | 1M | 128K | Active |62| Claude Opus 4.6 | `claude-opus-4-6` | — | 1M | 128K | Active |63| Claude Sonnet 4.6 | `claude-sonnet-4-6` | - | 1M | 64K | Active |64| Claude Haiku 4.5 | `claude-haiku-4-5` | `claude-haiku-4-5-20251001` | 200K | 64K | Active |6566### Model Descriptions67- **Claude Opus 4.8** — The most capable Claude model to date — highly autonomous, state-of-the-art on long-horizon agentic work, knowledge work, and memory; clearer, warmer writing. Same API surface as Opus 4.7 (adaptive thinking only; sampling parameters and `budget_tokens` removed). 1M context window at standard API pricing (no long-context premium). See `shared/model-migration.md` → Migrating to Opus 4.8 — a 4.7 → 4.8 move is a model-ID swap plus prompt re-tuning, no new breaking changes.68- **Claude Opus 4.7** — Previous-generation Opus. Highly autonomous; strong on long-horizon agentic work, knowledge work, vision, and memory. Adaptive thinking only; sampling parameters and `budget_tokens` removed. 1M context window. See `shared/model-migration.md` → Migrating to Opus 4.7.69- **Claude Opus 4.6** — Older Opus. Supports adaptive thinking (recommended), 128K max output tokens (requires streaming for large outputs). 1M context window.70- **Claude Sonnet 4.6** — Our best combination of speed and intelligence. Supports adaptive thinking (recommended). 1M context window. 64K max output tokens.71- **Claude Haiku 4.5** — Fastest and most cost-effective model for simple tasks.7273## Legacy Models (still active)7475| Friendly Name | Alias (use this) | Full ID | Status |76|-------------------|---------------------|-------------------------------|--------|77| Claude Opus 4.5 | `claude-opus-4-5` | `claude-opus-4-5-20251101` | Active |78| Claude Opus 4.1 | `claude-opus-4-1` | `claude-opus-4-1-20250805` | Active |79| Claude Sonnet 4.5 | `claude-sonnet-4-5` | `claude-sonnet-4-5-20250929` | Active |80| Claude Sonnet 4 | `claude-sonnet-4-0` | `claude-sonnet-4-20250514` | Active |81| Claude Opus 4 | `claude-opus-4-0` | `claude-opus-4-20250514` | Active |8283## Deprecated Models (retiring soon)8485| Friendly Name | Alias (use this) | Full ID | Status | Retires |86|-------------------|---------------------|-------------------------------|------------|--------------|87| Claude Haiku 3 | — | `claude-3-haiku-20240307` | Deprecated | Apr 19, 2026 |8889## Retired Models (no longer available)9091| Friendly Name | Full ID | Retired |92|-------------------|-------------------------------|-------------|93| Claude Sonnet 3.7 | `claude-3-7-sonnet-20250219` | Feb 19, 2026 |94| Claude Haiku 3.5 | `claude-3-5-haiku-20241022` | Feb 19, 2026 |95| Claude Opus 3 | `claude-3-opus-20240229` | Jan 5, 2026 |96| Claude Sonnet 3.5 | `claude-3-5-sonnet-20241022` | Oct 28, 2025 |97| Claude Sonnet 3.5 | `claude-3-5-sonnet-20240620` | Oct 28, 2025 |98| Claude Sonnet 3 | `claude-3-sonnet-20240229` | Jul 21, 2025 |99| Claude 2.1 | `claude-2.1` | Jul 21, 2025 |100| Claude 2.0 | `claude-2.0` | Jul 21, 2025 |101102## Resolving User Requests103104When a user asks for a model by name, use this table to find the correct model ID:105106| User says... | Use this model ID |107|-------------------------------------------|--------------------------------|108| "opus", "most powerful" | `claude-opus-4-8` |109| "opus 4.8" | `claude-opus-4-8` |110| "opus 4.7" | `claude-opus-4-7` |111| "opus 4.6" | `claude-opus-4-6` |112| "opus 4.5" | `claude-opus-4-5` |113| "opus 4.1" | `claude-opus-4-1` |114| "opus 4", "opus 4.0" | `claude-opus-4-0` (deprecated — suggest `claude-opus-4-8`) |115| "sonnet", "balanced" | `claude-sonnet-4-6` |116| "sonnet 4.6" | `claude-sonnet-4-6` |117| "sonnet 4.5" | `claude-sonnet-4-5` |118| "sonnet 4", "sonnet 4.0" | `claude-sonnet-4-0` |119| "sonnet 3.7" | Retired — suggest `claude-sonnet-4-5` |120| "sonnet 3.5" | Retired — suggest `claude-sonnet-4-5` |121| "haiku", "fast", "cheap" | `claude-haiku-4-5` |122| "haiku 4.5" | `claude-haiku-4-5` |123| "haiku 3.5" | Retired — suggest `claude-haiku-4-5` |124| "haiku 3" | Deprecated — suggest `claude-haiku-4-5` |125