HomeAPIs › 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, June 2026)

ModelInput $/1MOutput $/1MBest for
Claude Opus 4$15.00$75.00Hardest reasoning, top quality
Claude Sonnet 4$3.00$15.00Balanced workhorse
Claude Haiku 3.5 cheapest$0.80$4.00High volume, fast tasks
⚠️ Reference prices, June 2026 — confirm on anthropic.com/pricing. Prompt caching and batch jobs can cut these substantially. Output is billed separately and costs more.

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 KeysCreate 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.