Updated November 2026 · Every model, price, limit and code sample rechecked against Anthropic’s documentation on November 12.
A plain-English guide to the Claude API: what it is, what each model costs today, how to get access, and the few lines of Python that make your first call.
The short version: The Claude API lets your own code, spreadsheet automations or apps send text to Claude and get answers back, paying per use instead of a monthly chat subscription. As of November 2026 there are four main models: Fable 5.2 ($8 / $40 per million tokens in / out), Opus 5.5 ($4 / $20), Sonnet 5.5 ($2 / $10) and Haiku 5.5 ($0.10 / $0.50). All four read up to 1 million tokens at once. You sign up in the Claude Console at platform.claude.com, install the anthropic Python package and run about ten lines of code. Max, Ultra and Team subscribers also get monthly API credits included.
Instead of chatting in a browser window, the API gives your programs direct access to Claude. You can build a support bot, sort a thousand emails overnight, or connect Claude to a Zapier or Make automation that runs while you sleep. If you’ve used Claude through the chat app and wondered how to build something on top of it, start here. A lot has changed since we first wrote this guide in March: new models, much lower prices for the cheapest model, and a different sign-in. Our daily newsletter covered Fable 5.2 and its price the week it launched.
What changed since March 2026
If you’re following an older tutorial, this table shows what our March version said and what’s true now.
| Topic | Our March 2026 guide | November 2026 |
|---|---|---|
| Top model | Opus 4.6, $5 / $25 | Fable 5.2, $8 / $40 (Opus 5.5 is $4 / $20) |
| Middle model | Sonnet 4.6, $3 / $15 | Sonnet 5.5, $2 / $10 |
| Cheapest model | Haiku 4.5, $1 / $5 | Haiku 5.5, $0.10 / $0.50 for prompts up to 100,000 tokens |
| Context window | 1M on Opus and Sonnet, 200K on Haiku | 1M on all four |
| Where you sign up | console.anthropic.com | platform.claude.com (the Claude Console) |
| Signing in from your computer | API key only | The ant command-line tool is recommended; an API key still works |
| Trying prompts without code | The Console playground (then called Workbench) | Playground, renamed on August 18, 2026; old Workbench prompts weren’t carried over |
| Starter limits | “Tier 1”, about 50 requests a minute | “Start” tier, 4,000 requests a minute on the current models (brand-new accounts may begin lower) |
Setting temperature | Works everywhere | Returns an error on all four current models |
| Subscriber credits | None | Max $100, Ultra $200 a month; Team up to $500, pooled |
What we noticedThe biggest change for beginners is the price of the smallest model. Haiku 5.5 costs a tenth of what Haiku 4.5 cost in March for both input and output, as long as your prompt is under 100,000 tokens. The second can trip you up. Code copied from an older tutorial that sets temperature fails on every current model. We cover both below.
What Is the Claude API?
An API (application programming interface) is a set way for two programs to talk to each other. The Claude API lets your code send a message to Anthropic’s servers and get Claude’s reply back as data your program can read, store or pass along, instead of a chat bubble on a screen.
The Claude chat app is like phoning a restaurant and placing an order. The API is a direct line to the kitchen. Your program sends in orders, gets results back, and can handle many orders at once without waiting in line.
Anthropic, the AI safety company founded in 2021 by Dario and Daniela Amodei, runs the API. You can read background on every Claude model on Grokipedia.
Why Use the API Instead of the Chat Interface?
The chat app at claude.ai is great for one-off conversations, brainstorming and quick questions. The API can do things the chat app can’t:
- Automation: process thousands of documents overnight without touching a keyboard
- Integration: put Claude inside your website, app, Slack bot or customer database
- Scale: send many requests at the same time
- Control: set the system prompt, response length and output format yourself
- Cost: pay per use instead of a flat monthly plan, which suits light or uneven use
- Data pipelines: feed Claude’s answers straight into spreadsheets, databases or other apps
Who Is the Claude API For?
You don’t need to be a software engineer. Several kinds of people use it:
Developers add AI features to products: chatbots, writing helpers, search and coding tools. The official Python and TypeScript libraries need only a few lines of code for a basic call.
Small businesses automate support replies, draft marketing copy, pull data out of invoices and build internal tools.
Automation builders on Make.com, Zapier or n8n connect Claude to other services without traditional code. A scenario can take an email, ask Claude to summarize it, and post the summary to Slack.
Low-code builders use tools like Bubble, Retool or Streamlit to make simple apps on top of Claude. If you’re comfortable with spreadsheet formulas, a basic API connection is within reach.
Researchers and analysts process large batches: classifying survey answers, summarizing papers, pulling facts out of long reports. Every current model has a 1-million-token context window, enough for a long book in one request.
How to Get Claude API Access
These steps follow Anthropic’s Get started guide.
Step 1: Create a Claude Console account. Go to platform.claude.com and sign up. The Console is where you manage API access, billing and usage. Anthropic says new users receive free credits to test the API; it doesn’t publish the amount.
Step 2: Choose how your computer signs in. Anthropic now recommends ant, a small tool you run by typing commands in Terminal. On a Mac with Homebrew installed, run brew install anthropics/tap/ant, then ant auth login, and approve the sign-in in your browser. Anthropic’s official code libraries then use that sign-in automatically. The older route also still works: create an API key in the Console’s settings and store it as an environment variable (Step 4). Copy a new key straight away, keep it in a password manager, and never paste it into your code or share it.
Step 3: Add credits when you need them. The API is pay-as-you-go. Billing is in the Console settings, and you can set a monthly spend limit so a mistake can’t run up a big bill.
Step 4 (API key route only): set your key as an environment variable, a setting your computer keeps outside your code so the key never sits in your script. On a Mac or Linux, run this in Terminal before you run your script. On Windows, use set ANTHROPIC_API_KEY=... instead.
export ANTHROPIC_API_KEY="paste-your-key-here"
Already paying for Claude? Max, Ultra and Team plans include API credits every month: $100 on Max, $200 on Ultra, and on Team $20 per Standard seat or $100 per Premium seat, pooled up to $500. To claim them, link your Console account (Anthropic calls it an organization) in your claude.ai billing settings. New subscribers wait seven days. They cover the API and the Console playground but not Claude Code, and unused credits expire at the end of each billing cycle. Free, Pro and Enterprise plans don’t get them.

Claude API Pricing: Every Model Compared (November 2026)
Prices are per million tokens, the small chunks of text models read and write. One million tokens is roughly 555,000 words. These figures come from Anthropic’s pricing page and models overview on November 12, 2026.
| Model | API ID | Input | Output | Best for (Anthropic’s words) |
|---|---|---|---|---|
| Claude Fable 5.2 | claude-fable-5-2 | $8 | $40 | Demanding reasoning and long-horizon agentic work |
| Claude Opus 5.5 | claude-opus-5-5 | $4 | $20 | Long-running agentic coding and knowledge work |
| Claude Sonnet 5.5 | claude-sonnet-5-5 | $2 | $10 | The best combination of speed and intelligence |
| Claude Haiku 5.5 | claude-haiku-5-5 | $0.10 ($0.50 over 100K) | $0.50 ($2.50 over 100K) | High-volume, latency-sensitive tasks such as classification, extraction and routing |
All four have a 1-million-token context window, write up to 128,000 tokens in one reply, and have knowledge up to June 2026. Haiku 5.5 is the one model that charges more for long prompts: requests over 100,000 tokens pay the higher rate in brackets. The others charge the same per token whether a prompt is short or close to a million.

Which one should a beginner use? Anthropic’s own advice is to start with Opus 5.5 if you’re unsure, and every official code sample uses it. If cost matters most, its model guide suggests starting with Haiku 5.5 and moving up only if the answers aren’t good enough.
We worked out what a simple job costs on each model: 10,000 short questions, each about 50 tokens in, with answers around 500 tokens out.
What 10,000 short answers cost
Fable 5.2
Opus 5.5
Sonnet 5.5
Haiku 5.5
You can cut the bill three ways.
- Batch API: 50% off input and output for jobs that can wait (most finish within an hour, all within 24 hours).
- Prompt caching: when you send the same long instructions again and again, the repeat reads cost a fraction of the normal input price. On Sonnet 5.5 a cached read is $0.10 per million tokens instead of $2. Saving to the cache costs a little more than normal input the first time.
- Start small: Haiku 5.5’s input price is 97.5% lower than Opus 5.5’s.
Older prices aren’t a straight comparison. Anthropic says models from 4.7 onward split the same text into about 30% more tokens than earlier models, so a token today buys a little less text.
Your First Claude API Call (Python)
This follows Anthropic’s quickstart. You need Python 3.10 or later. First make a project folder and a virtual environment (a private space so this project’s add-ons don’t mix with others), then install the official library:
mkdir claude-quickstart && cd claude-quickstart
python3 -m venv .venv && source .venv/bin/activate
pip install anthropic
Then save this as quickstart.py:
import anthropic
# The SDK reads ANTHROPIC_API_KEY from your environment automatically
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-opus-5-5",
max_tokens=1000,
messages=[
{"role": "user", "content": "Explain what an API is in one paragraph, using a restaurant analogy."}
],
)
# Claude can send a "thinking" block before its answer, so print only the text blocks
for block in message.content:
if block.type == "text":
print(block.text)
print(message.usage) # how many tokens went in and came out

What each part does:
import anthropicloads Anthropic’s official Python library.anthropic.Anthropic()creates a client that signs in with yourantlogin or yourANTHROPIC_API_KEY.client.messages.create()sends your message, the model name and the longest reply you’ll accept.- The
forloop prints only the text. Current models may think first and send that thinking as a separate block, somessage.content[0].textfrom older tutorials can print the wrong part or fail. message.usageshows the tokens used, so you can see what the call cost.
Run it with python quickstart.py. A reply of a few hundred tokens on Opus 5.5 costs around a cent; change the model line to claude-haiku-5-5 and it costs about a fortieth as much.
Adding a System Prompt
A system prompt tells Claude how to behave for the whole conversation. It’s the easiest way to control tone and focus. This version also switches to the cheaper Haiku 5.5:
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-haiku-5-5",
max_tokens=1000,
system="You are a patient coding tutor for absolute beginners. Explain ideas with everyday examples and define every technical word you use.",
messages=[
{"role": "user", "content": "What is an API key and why do I need one?"}
],
)
for block in message.content:
if block.type == "text":
print(block.text)
For more on writing instructions that work, see our guide to writing AI prompts.
The Same Call in TypeScript
If you work in JavaScript, you need Node.js 20 or later (the program that runs JavaScript outside a browser). Install the library with npm install @anthropic-ai/sdk and use:
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic();
const message = await client.messages.create({
model: "claude-opus-5-5",
max_tokens: 1000,
messages: [{ role: "user", content: "Explain what an API is in one paragraph." }],
});
for (const block of message.content) {
if (block.type === "text") console.log(block.text);
}
Key Concepts Explained Simply
Six ideas cover most of what you’ll meet when you start building.
Tokens
Tokens are the pieces of text a model reads and writes; a word is often one or two tokens. You pay for the tokens you send (input) and the tokens Claude writes back (output), and output costs more. The Console shows the tokens used by every request.
Context Windows
The context window is how much text Claude can take in at once, counting your instructions, the conversation so far and any documents. Every current model handles 1 million tokens, roughly 555,000 words. Longer requests cost more and take longer, so send what the task needs.
System Prompts
A system prompt is a set of instructions that sits above the conversation and shapes every answer. A support bot might get: “You are a support agent for Acme. Only answer questions about our products. If you don’t know, say so and offer to connect the customer with a person.”
Temperature (and why old tutorials break)
Older guides tell you to set temperature to make answers more or less random. On all four current models, Anthropic’s docs say a request that sets temperature, top_p or top_k (three settings that control how random answers are) to anything but the default returns an error, and with the newest API version, setting them at all does. If a copied example fails, remove those settings first and steer Claude with clearer instructions instead.
Streaming
Normally the API waits until the whole answer is ready. Streaming sends it piece by piece as it’s written, which is how the chat app shows words appearing. For anything a person waits on, streaming makes it feel faster. The Python library does this with client.messages.stream().
Thinking and Effort
Current models can reason before they answer. Instead of setting a thinking budget by hand, as older guides describe, Claude now decides how much to think, and you steer it with an effort setting: lower for quick, cheap answers, higher for hard problems. Thinking counts as output tokens, so more effort costs more. Anthropic’s docs say manual thinking budgets aren’t accepted on models after the 4.6 generation.
Claude API vs OpenAI API: A Side-by-Side Comparison
Most people choosing an AI API compare Anthropic with OpenAI. Here are the current price lists side by side, from Anthropic and OpenAI on November 12, 2026 (per million tokens, standard short-prompt prices):
| Role | Claude | OpenAI |
|---|---|---|
| Flagship | Fable 5.2: $8 / $40 | GPT-6 Astra: $10 / $50 |
| Balanced | Sonnet 5.5: $2 / $10 (Opus 5.5: $4 / $20) | GPT-6.1 Sol: $2 / $10 |
| Cheapest | Haiku 5.5: $0.10 / $0.50 | GPT-6 Luna: $0.10 / $0.50 |
| Batch discount | 50% | 50% |
On price the two are now close, and at the cheap end they’re identical. The choice comes down to which model does your task better, so try the same prompt on both before you commit. OpenAI describes its lineup on its models page; for the chat apps, see our ChatGPT vs Claude vs Gemini comparison. Many apps use both: a strong model for the hard steps and a cheap one for simple sorting.
What Can You Build with the Claude API?
A few things people build first:
Customer Support Chatbots
Put your product guides and policies in the system prompt (with caching to keep repeats cheap) and let Claude answer common questions, handing harder ones to a person.
Content Generation
Draft product descriptions, emails or social posts from a template, with a system prompt that sets the tone and reading level so the output stays consistent.
Document Analysis and Summarization
Send contracts, reports or research papers and ask for a summary, a list of risks or specific facts. With 1 million tokens of context, long documents fit in one request, and the citations feature can point to the exact passages Claude used.
Code Generation and Review
Have Claude write, explain or review code, for example checking changes for bugs before they go live. For coding on your own computer, our Claude Code beginners guide is the easier route.
Data Extraction and Structuring
Turn messy text such as emails, invoices or web pages into clean rows for a spreadsheet. A feature called structured outputs makes Claude return data in the exact format your program expects.
Classification and Routing
Tag support tickets by topic and urgency, sort emails to the right team, or label survey answers. Haiku 5.5 suits this kind of quick, high-volume work.
Research Assistants
Feed in a stack of papers and ask for common themes, disagreements and gaps. The web search tool lets Claude look up current sources too, at $10 per 1,000 searches.
Multi-Language Translation and Localization
Translate product listings or help articles into several languages while keeping your terms and tone, and have a native speaker check anything customer-facing.
Rate Limits and Best Practices
Anthropic limits how much each account can send. The rate limits page describes the current tiers: Evaluation, Start, Build, Scale and Custom. New accounts may begin in Evaluation, whose limits aren’t published, and move up automatically based on usage history.
Limits worth knowing
If you hit a limit, the API sends back an error (code 429, meaning too many requests), usually with a note saying how long to wait. The official libraries retry a couple of times for you. If you hit the monthly spend cap, retrying won’t help: API use pauses until the start of the next month unless you ask for a higher limit.
A few habits save money and trouble.
- Use prompt caching for instructions you send on every request.
- Pick the smallest model that does the job well; test Haiku 5.5 before reaching for Opus or Fable.
- Set
max_tokensto what you need; a yes/no answer doesn’t need 4,000 tokens. - Use the Batch API for anything that can wait a few hours.
- Set a spend limit in the Console and check usage there regularly; see our Claude usage limits guide for how the chat-app limits differ.
- Store answers you’ll reuse instead of asking Claude the same question twice.
Tools and Function Calling
Tool use, also called function calling, lets Claude ask your code to do things: look something up in a database, check the weather, send an email.
- You describe the tools (their names and what information they need) in your request.
- Claude reads the message and decides whether a tool would help.
- If so, it replies with the tool name and the details to use.
- Your code runs the tool and sends the result back.
- Claude uses the result in its final answer.
For example, with a get_stock_price tool, a question about Apple’s share price leads Claude to ask for {"ticker": "AAPL"}; your code fetches the live price and Claude answers with it.
Anthropic also runs some tools for you, such as web search and web fetch. The MCP connector links Claude to ready-made add-ons built on the Model Context Protocol, an open standard for connecting AI to other apps. Claude Managed Agents run whole AI agents in Anthropic’s cloud (tokens plus $0.08 for each hour an agent runs). To build agents in your own code, see the Claude Agent SDK and our Agent SDK tutorial.
Building with No-Code Tools
You don’t have to write Python to use the Claude API:
Playground in the Claude Console lets you try prompts, models and settings in your browser and shows the matching code for each run. It replaced Workbench in August 2026, and runs there count as API usage.
Make.com has an Anthropic module, so a scenario can watch Gmail, send each new email to Claude for a summary, post it to Slack and log it in Google Sheets. Our Make guide walks through the basics.
Zapier has an Anthropic integration too. It’s simpler than Make but less flexible for long multi-step flows; see our Zapier AI guide.
n8n is an open-source automation tool with an Anthropic step built in. You run it yourself, on your own computer or a rented one, which takes some technical comfort. Start with our n8n guide.
Streamlit isn’t no-code, but it builds a simple web app around Claude in a few dozen lines of Python. For tools that need no setup at all, see our best AI tools for beginners.
Resources and Official Documentation
- Claude Platform docs: the full API reference, guides and tutorials
- Features overview: every capability in one list, from structured outputs to the Files API
- Model deprecations: retirement dates for older models (Sonnet 4.5 retires November 30, 2026)
- Python SDK and TypeScript SDK on GitHub
- Claude Console: keys, usage, billing, spend limits and playground
- Anthropic Cookbook: example code for common jobs
- Grokipedia: Claude (language model): background on every Claude version
Frequently Asked Questions
How much does the Claude API cost?
You pay per million tokens. In November 2026, Haiku 5.5 costs $0.10 in and $0.50 out for prompts up to 100,000 tokens, Sonnet 5.5 $2 / $10, Opus 5.5 $4 / $20 and Fable 5.2 $8 / $40. A short question and answer costs a fraction of a cent on Haiku or Sonnet and a cent or two on Opus or Fable. The Batch API halves the price for work that can wait.
Is the Claude API free?
Only at first. Anthropic says new users get free credits to test it but doesn’t publish the amount, and after that it’s pay-as-you-go. Max ($100), Ultra ($200) and Team subscribers get monthly API credits included. For free use without code, the claude.ai chat app has a free plan with limited daily use.
Claude API vs ChatGPT API: which is better?
Neither wins everywhere. Their prices are now close: Haiku 5.5 and GPT-6 Luna both cost $0.10 / $0.50, and Sonnet 5.5 and GPT-6.1 Sol both cost $2 / $10, while Fable 5.2 is cheaper than GPT-6 Astra. Test your own task on both and pick the one whose answers you prefer.
How do I get a Claude API key?
Sign up at platform.claude.com, open the Console settings and create a key. Copy it once, store it in a password manager, and set it as the ANTHROPIC_API_KEY environment variable. Anthropic now recommends signing in with its ant tool instead, which avoids handling a key for local projects.
Can I use the Claude API without coding?
Yes. Playground in the Claude Console lets you try prompts in your browser, and Make.com, Zapier and n8n connect Claude to other apps with drag-and-drop steps. If you’re brand new, start in the playground, then move to an automation tool.
Made for regular people, by a real person
One AI tool, tip or update a day in plain English, including what new models cost and whether they’re worth it. Curated and edited by a human.
Free forever. Unsubscribe anytime.
More Claude Guides from Beginners in AI
- How to Use Claude AI: Complete Guide
- Claude AI Login: How to Sign Up and Get Started
- Claude App: iOS, Android, and Desktop Guide
- Best Claude Prompts: 50 Examples
- Claude Code: Beginner’s Guide
- What’s New in Claude 2026

