Home โ€บ APIs โ€บ Anthropic Claude

Claude API โ€” pricing, credits & how to get a key

Anthropic's Claude models โ€” Opus, Sonnet and Haiku โ€” are known for strong reasoning, long context and reliable instruction-following. Here's what the API costs and how to start.

Claude API pricing (reference, July 2026)

ModelInput $/1MOutput $/1MBest for
Claude Opus 4.8$5.00$25.00Hardest reasoning, top quality
Claude Sonnet 4.6$3.00$15.00Balanced workhorse โ€” best default
Claude Haiku 4.5$1.00$5.00Fast, cheap, strong for its size
Claude Haiku 3.5 cheapest$0.80$4.00Highest volume, simplest tasks
โš ๏ธ Reference prices, July 2026 โ€” confirm on anthropic.com/pricing. Prompt caching and batch jobs can cut these substantially. Output is billed separately and costs more. ยท Report outdated price โ†’
โœ“ Last verified: 2026-07-15ยท Source: official provider pricing pageยท Auto-monitored โ€” report change โ†’

โ†’ Estimate your bill across Sonnet, Haiku and Opus with the Claude API cost calculator, or compare every provider on the full AI API cost calculator.

Is there a free tier?

Anthropic has no permanent free API tier. New accounts typically get a small amount of free credit in the Console to test with; after that it's pay-as-you-go. Haiku is cheap enough that prototyping costs very little. If you specifically want an ongoing free quota, Google Gemini is the better choice.

How to get an Anthropic API key (step by step)

1. Go to console.anthropic.com and create an account.
2. Open Billing and add a payment method / buy credits.
3. Go to API Keys โ†’ Create Key, name it, and copy it once (it won't be shown again).
4. Set a spend limit in Billing to avoid surprises.

Test it:

# replace $ANTHROPIC_API_KEY
curl https://api.anthropic.com/v1/messages \
ย ย -H "x-api-key: $ANTHROPIC_API_KEY" \
ย ย -H "anthropic-version: 2023-06-01" \
ย ย -H "content-type: application/json" \
ย ย -d '{"model":"claude-haiku-3-5","max_tokens":64,"messages":[{"role":"user","content":"hi"}]}'

Estimate your cost

Plug your token usage into the AI API Cost Calculator โ€” it compares Claude against GPT and Gemini and shows the cheapest model for your exact workload.

Cheaper alternatives

Within Claude, Haiku is far cheaper than Sonnet or Opus. Across providers, GPT-4o mini and Gemini Flash compete in the same low-cost tier; DeepSeek-V3 is cheaper still.

FAQ

How much does the Claude API cost?

Per million tokens: Haiku 3.5 โ‰ˆ $0.80 in / $4 out, Sonnet 4 โ‰ˆ $3 / $15, Opus 4 โ‰ˆ $15 / $75. Output costs more than input.

How do I get an Anthropic API key?

Sign up at console.anthropic.com, add credit under Billing, open API Keys, click Create Key, copy it once, and set a spend limit.

Can I reduce Claude costs?

Yes โ€” use Haiku where quality allows, enable prompt caching for repeated context, and use batch processing for non-urgent jobs (often ~50% cheaper).

Not affiliated with Anthropic. Prices are reference estimates โ€” always verify on the official pricing page.

Host your project:DigitalOcean โ€” $200 free โ†—Hostinger VPS

Exchanges

BybitBinanceOKXKuCoinBitgetGate.ioMEXC

Tools & Hosting

๐Ÿ“ˆ TradingView๐Ÿ”’ NordVPN๐Ÿ’ณ RevolutDigitalOcean $200Hostinger