Claude Code · Series · Part 4 of 8
The Claude API, every model so far, and the official links
Parts 1 to 3 were about using Claude Code well. This part is the reference shelf at the end of the beginner level (Parts 5 to 8 go further): how Claude Code differs from the Claude API, a first API call you can run in five minutes, every Claude model published so far with its API ID and status, and the official pages I rely on, all in one place. Models and pages change often, so every table here is a dated snapshot and the linked docs are the source of truth.
- Claude apps are for chatting, Claude Code works inside your project, and the Claude API is for building your own app on top of Claude.
- The API needs a Claude Console account and an API key. Keep the key in an environment variable and never ship it inside an app.
- Four models are current (Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5). Older ones are legacy, deprecated or retired.
- An alias like
sonnetis a convenience; a full ID likeclaude-sonnet-5-5is a pinned snapshot you can rely on. - The official links are grouped at the end, so you can bookmark one section.
1. Claude apps, Claude Code or the API?
The same models are reachable through different doors. Which one you want depends on what you are trying to do:
| Door | Use it to | You sign in with |
|---|---|---|
| Claude apps (claude.ai, desktop, phone) | Chat, write, analyse files. Nothing to install in a project. | A claude.ai account |
| Claude Code | Work inside your own project: read the code, edit files, run commands. | Pro, Max, Team or Enterprise, or a Console account |
| Claude API | Build Claude into your own app, website or backend. You send messages and get replies as data. | A Console account and an API key; billed per token |
| Agent SDK | Build your own agents powered by Claude Code's tools, with control over orchestration and permissions. | See the Agent SDK docs |
| Cloud providers (Amazon Bedrock, Google Cloud, Microsoft Foundry) | Use Claude through a cloud account your organisation already has. | Your cloud account |
2. The Claude API in five minutes
If you have read my Android post on online models, this will look familiar: the API takes the whole conversation as JSON and returns the next message. It does not remember anything between calls, so you re-send the history every time (the same idea as the context window in Part 2).
- Create a Console account at platform.claude.com. This is separate from a claude.ai chat plan and is billed by usage.
- Create an API key in the Console (see Get an API key) and store it somewhere safe. Treat it like a password.
- Put the key in an environment variable so it never appears in your code:
export ANTHROPIC_API_KEY="your-api-key-here" - Make a call. Here is the plain HTTP version from the official quickstart:
curl https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "claude-opus-5-5", "max_tokens": 1000, "messages": [ { "role": "user", "content": "Explain what a token is in one sentence." } ] }'
The reply is JSON. The text is in content, stop_reason says why it stopped, and usage reports the input_tokens and output_tokens you were charged for. The same call with the official Python library is shorter:
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY
message = client.messages.create(
model="claude-opus-5-5",
max_tokens=1000,
messages=[
{"role": "user", "content": "Explain what a token is in one sentence."}
],
)
for block in message.content:
if block.type == "text":
print(block.text)Official libraries exist for Python, TypeScript, C#, Go, Java, PHP and Ruby, plus a command-line tool, listed on the client SDKs page. The next page to read is Working with the Messages API: multi-turn conversations, system prompts and stop reasons.
Anyone can pull a key out of an app package or a web page. Keep it on a server you control, or have users supply their own, and use environment variables for local work. Do not commit it to git. (More in the Android post.)
Claude Code can also use a Console account. Per the official quickstart, the first time you sign in with one, a “Claude Code” workspace is created in the Console to track that usage separately.
3. Every Claude model published so far
This is the full lineup as the official docs list it on 14 October 2026. Anthropic retires old models regularly, so treat it as a snapshot and check the models overview and the model deprecations page for the live status. “MTok” means a million tokens.
Current lineup
| Model | API ID | Docs describe it as | Speed | Price in / out per MTok |
|---|---|---|---|---|
| Claude Fable 5.1 | claude-fable-5-1 | For demanding reasoning and long-horizon agentic work | Slower | $10 / $50 |
| Claude Opus 5.5 | claude-opus-5-5 | For long-running agentic coding and knowledge work. The docs suggest it as the starting point for most workloads. | Moderate | $4 / $20 |
| Claude Sonnet 5.5 | claude-sonnet-5-5 | The best combination of speed and intelligence | Fast | $2 / $10 |
| Claude Haiku 5.5 | claude-haiku-5-5 | For high-volume, latency-sensitive tasks such as classification, extraction and routing | Fastest | From $0.10 / $0.50 |
All four accept text and image input, have a 1M-token context window and up to 128K tokens of output on the standard API, and are listed as not retiring sooner than September to October 2027. Prices are Claude API base prices and are separate from a Claude subscription. Two discounts from the pricing notes: batch requests are 50% off, and prompt-cache reads cost a fraction of the base input price (10% in general, and 2.5% to 5% on some of these models), which is why a stable CLAUDE.md is cheap to re-read (Part 3). See the pricing page for cache writes, long-context and per-platform rates.
Other models still active
| Model | API ID | Not retiring sooner than |
|---|---|---|
| Claude Mythos 5.1 | claude-mythos-5-1 | 1 Sep 2027 |
| Claude Fable 5 | claude-fable-5 | 9 Jun 2027 |
| Claude Mythos 5 | claude-mythos-5 | 9 Jun 2027 |
| Claude Opus 5 | claude-opus-5 | 24 Jul 2027 |
| Claude Opus 4.8 | claude-opus-4-8 | 28 May 2027 |
| Claude Opus 4.7 | claude-opus-4-7 | 16 Apr 2027 |
| Claude Opus 4.6 | claude-opus-4-6 | 5 Feb 2027 |
| Claude Opus 4.5 | claude-opus-4-5-20251101 | 24 Nov 2026 |
| Claude Sonnet 5 | claude-sonnet-5 | 30 Jun 2027 |
| Claude Sonnet 4.6 | claude-sonnet-4-6 | 17 Feb 2027 |
| Claude Haiku 4.5 | claude-haiku-4-5-20251001 | 15 Oct 2026 |
The overview page calls Fable 5, Opus 5 and 4.x, Sonnet 5 and 4.6 and Haiku 4.5 “legacy”: still available, but no longer receiving updates. The Mythos models are listed as active in the deprecations table, but I could not find a plain description of them, so see the docs before relying on them.
Deprecated and retired
| Model | API ID | Status |
|---|---|---|
| Claude Sonnet 4.5 | claude-sonnet-4-5-20250929 | Deprecated 30 Sep 2026, retires 30 Nov 2026 (replacement: Sonnet 5.5) |
| Claude Mythos Preview | claude-mythos-preview | Deprecated 9 Jun 2026, retirement date to be announced |
| Claude Opus 4.1 | claude-opus-4-1-20250805 | Retired 5 Aug 2026 |
| Claude Opus 4 and Sonnet 4 | claude-opus-4-20250514, claude-sonnet-4-20250514 | Retired 15 Jun 2026 |
| Claude Haiku 3 | claude-3-haiku-20240307 | Retired 20 Apr 2026 |
| Claude Sonnet 3.7 and Haiku 3.5 | claude-3-7-sonnet-20250219, claude-3-5-haiku-20241022 | Retired 19 Feb 2026 |
| Claude Opus 3 | claude-3-opus-20240229 | Retired 5 Jan 2026 |
| Claude Sonnet 3.5 (two versions) | claude-3-5-sonnet-20240620, claude-3-5-sonnet-20241022 | Retired 28 Oct 2025 |
| Claude 2, 2.1 and Sonnet 3 | claude-2.0, claude-2.1, claude-3-sonnet-20240229 | Retired 21 Jul 2025 |
| Claude 1.x and Instant 1.x | claude-1.0 to claude-1.3claude-instant-1.0 to claude-instant-1.2 | Retired 6 Nov 2024 |
IDs, aliases and other platforms
- Every Claude model ID is a pinned snapshot. From the 4.6 generation on, IDs have no date suffix (for example
claude-sonnet-5-5) and are still a fixed snapshot. Older models have dated IDs such asclaude-haiku-4-5-20251001. - Claude Code aliases like
sonnetoropusare shortcuts to the latest version (Part 1, section 7). Use a full ID when you need repeatable behaviour. - Other platforms: Google Cloud, Microsoft Foundry and Claude Platform on AWS use the same IDs as the Claude API. Amazon Bedrock prefixes them, for example
anthropic.claude-opus-5-5, and Bedrock and Google Cloud set their own retirement dates. - Ask the API itself. The Models API returns the models your key can use, with their token limits and capabilities, so you do not have to hard-code a list.
4. Choosing between models
The official guidance, put plainly:
| If you need… | Start with | Why |
|---|---|---|
| A sensible default for most work | Opus 5.5 | The API docs name it the starting point for most workloads. |
| The hardest reasoning or very long agentic tasks | Fable 5.1 | Described as for demanding reasoning and long-horizon agentic work, or when Opus 5.5 at higher effort still falls short. |
| Speed with strong intelligence, lower cost | Sonnet 5.5 | The best combination of speed and intelligence. The Claude Code cost guide says Sonnet handles most coding tasks well. |
| Huge volume or very low latency | Haiku 5.5 | For classification, extraction and routing. |
Two sources, two slightly different defaults: the API guide starts you at Opus 5.5, while the Claude Code cost guide suggests Sonnet for everyday coding and Opus for complex architecture. Both are consistent with one rule: start with the model your plan defaults to, move down to save time and money when the task is easy, and move up when you are stuck. Test on your own tasks, because a cheaper model that passes your checks is the better choice. The docs have a choosing a model guide, and the migration guide helps when you move to a newer generation.
5. Official links
All of these were reachable when I wrote this post. Anthropic reorganises its docs from time to time (the Claude Code docs, for example, moved to code.claude.com), so if a link breaks, search the docs index at code.claude.com/docs/llms.txt.
Claude Code: getting started
| Page | What it covers |
|---|---|
| Overview | What Claude Code is, install commands, every interface. |
| Quickstart | Install, sign in, first questions and first change. |
| Terminal guide for new users | Opening a terminal and installing, step by step. |
| Advanced setup | System requirements, install methods, updates, uninstall. |
| Troubleshoot installation | Matches install and login error messages to fixes. |
| How Claude Code works | The agentic loop, built-in tools, how it uses your project. |
| Best practices | Prompting and project setup for better results. |
| Common workflows | Step-by-step guides for debugging, testing, refactoring. |
Claude Code: memory, settings and control
| Page | What it covers |
|---|---|
| How Claude remembers your project | CLAUDE.md, rules, imports, AGENTS.md, auto memory (Part 2). |
| Extend Claude with skills | SKILL.md and on-demand instructions. |
| Settings files and precedence | Which settings file wins. |
| Configure permissions | Allow, ask and deny rules. |
| Choose a permission mode | Manual, accept edits, plan, auto and more (Part 1). |
| Model configuration | Aliases, /model, effort levels, priority order. |
| Commands | Every slash command. |
| Manage sessions | Resume, name, branch, where transcripts are stored. |
| Manage costs effectively | Tracking usage and reducing tokens (Part 3). |
| Extend Claude Code | How CLAUDE.md, skills, MCP and the rest fit together. |
Claude API and models
| Page | What it covers |
|---|---|
| Claude Console | Create an account, API keys, usage and billing. |
| Get started with Claude | Your first API call in several languages. |
| Working with the Messages API | Multi-turn chats, system prompts, stop reasons. |
| Models overview | The current lineup, IDs and limits. |
| Choosing a model | Picking the right model for a use case. |
| Model deprecations | Status and retirement dates for every model. |
| Pricing | Token prices, batch and caching rates. |
| Client SDKs | Official libraries for each language. |
| Models API | List the models your key can use, with capabilities. |
Plans, learning and help
| Page | What it covers |
|---|---|
| Claude plans and pricing | Pro, Max, Team and Enterprise subscriptions. |
| Supported countries | Where Claude is available. |
| Claude Academy | Free self-paced courses, including Claude Code 101. |
| Support centre | Account, billing and plan help. |
| Community Discord | Tips and support from other users. |
6. Beginner-level wrap-up and glossary
- Part 1: set up Claude Code safely, learn the modes, and pick a model.
- Part 2: give Claude lasting context with CLAUDE.md, rules and skills.
- Part 3: spend fewer tokens, hand work off between sessions and onboard faster.
- Part 4: use the API when you want Claude inside your own product, and keep the model list and links handy.
- Next (advanced): Part 5 covers day-to-day prompting, git and troubleshooting.
The model forgets by design and the docs change often. Writing things down, and checking the official pages when something looks off, are the two habits that carry through all four parts.
| Term | In plain words |
|---|---|
| API | A way for one program to talk to another. The Claude API lets your code send messages to Claude and read the replies. |
| API key | A secret string that identifies your account when you call the API. Treat it like a password. |
| Console | Anthropic's web dashboard for API accounts: keys, usage and billing. |
| SDK | An official library that makes API calls easier in a given language. |
| Messages API | The main Claude API endpoint: you send a list of messages and get the next one back. |
| Model ID | The exact name of a model to request, such as claude-sonnet-5-5. |
| Snapshot | A fixed version of a model. A pinned ID always gives the same model. |
| MTok | One million tokens, the unit prices are quoted in. |
| Deprecated / retired | Deprecated models still work but have a retirement date; retired models no longer respond. |