API
Build with the API: tool use and structured outputs
For developers building with the Claude API — from your first request to tool use, structured outputs, and per-model pricing and context windows. Content follows the official docs at platform.claude.com, and pricing/model facts are re-verified on a regular schedule.
Browse
Getting Started
7Getting started with the Claude API — issuing keys, billing, your first call, and error handling with retries.
Models
5Choosing Claude API models — model IDs and versioning, context windows and tokens, and model comparisons.
Tool Use
4Tool use with the Claude API — how function calling works, structured outputs, and best practices.
Advanced
4Advanced Claude API usage — cost optimization, streaming, handling errors and rate limits, and extended thinking.
SDK
4Building with the official SDKs — using the Claude Agent SDK and others, plus streaming, to develop applications.
Latest
Claude SDK Error Handling and Retries: APIError Types, max_retries, and Timeout Config
A practical guide to how the Claude API's Python and TypeScript SDKs classify errors into typed exceptions, which failures get retried automatically, and how to customize retry and timeout behavior.
Opus vs Sonnet: Opus 5.5 vs Sonnet 5 — Which Claude Model Should You Use?
Claude Opus 5 and Sonnet 5 differ in price, speed, context window, and thinking mode. Here's how to pick the right one in the API or the Claude.ai app.
How to Get a Claude Code API Key: Console Setup Guide
A step-by-step guide to generating an API key in the Claude Console and connecting it to Claude Code with an environment variable.
Claude API Tool Definitions: Naming and Description Rules Without the Guesswork
A beginner-friendly walkthrough of how to name and describe tools in the Claude API so Claude calls the right one at the right time, based on official documentation.
Claude API Pricing by Model — Input/Output Token Rates and How to Cut Costs with Batch and Prompt Caching
Compare Claude API token pricing across Opus 5, Sonnet 5, Haiku 4.5, and Fable 5.1, and learn how Batch API's 50% discount and prompt caching's up to 90% discount can lower your costs.
Claude API Payment Failing? Fix Credit Balance & Billing Errors (2026)
Fix Claude API payment and credit errors by error code: 400 balance-too-low, 402 billing, 429 rate limit, plus how to top up and prevent recurrence — based on official docs.