Last refreshed: September 25, 2026
Model Accuracy Note — Updated May 2026
Lineup currency (Sept 2026, verified): Sonnet 5 ($2/$10), Opus 5.5 ($4/$20), Haiku 4.5 ($1/$5), Fable 5.1 ($10/$50). Legacy (still listed): Opus 4.8 ($5/$25), Sonnet 4.6 ($3/$15). Prior note (superseded): Prior flagship claim: Claude Opus 4.7 (claude-opus-4-7). Prior models claim: Opus 4.7 · Sonnet 4.6 · Haiku 4.5. Claude Opus 4.7 (claude-opus-4-7) was claimed current as of April 16, 2026. Where this article references Opus 4.6 or earlier models, those references are historical. See current model tracker →. See current model tracker →
The Claude API gives you programmatic access to Claude in your own applications and scripts. This guide gets you from zero to a working integration in Python or JavaScript.
Prerequisites

- Anthropic account at console.anthropic.com
- API key from Console → API Keys
- Python 3.7+ or Node.js 18+
Installation
# Python
pip install anthropic
# JavaScript
npm install @anthropic-ai/sdk
Your First API Call (Python)

import anthropic
client = anthropic.Anthropic(api_key="your-api-key-here")
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain APIs in plain English."}]
)
print(message.content[0].text)
Adding a System Prompt
message = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
system="You are a helpful customer support agent for Acme Corp.",
messages=[{"role": "user", "content": "How do I reset my password?"}]
)
Streaming Responses

with client.messages.stream(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Write a 500-word blog post about AI."}]
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
Model Selection
| Model | String | Best For |
|---|---|---|
| Claude Opus 4.6 | claude-opus-4-7 | Complex reasoning, coding |
| Claude Sonnet 4.6 | claude-sonnet-4-6 | Balanced everyday tasks |
| Claude Haiku 4.5 | claude-haiku-4-5-20251001 | Fast lightweight tasks |
Frequently Asked Questions
How much does the Claude API cost?
Pricing is per token (input and output separately). Check anthropic.com/pricing. Haiku is cheapest, Sonnet offers the best cost/quality balance for most applications.
Do I need a Claude subscription to use the API?
No. API access is separate. Create an Anthropic Console account and pay per token used.
Get The Signal
What we actually ran, what it measured, and what it means for a restoration shop — every week, including the flops.

Leave a Reply