Anthropic API
apiby anthropic
Direct access to Claude models via a developer API. Pay per token pricing for text generation, tool use, vision, extended thinking, computer use, and more.
Key features
From $undefined/undefined
Developers building AI powered applications, chatbots, and agents that need direct model access with full control over prompts, parameters, and tool integrations
Claude models consistently lead on writing quality, instruction following, and nuanced reasoning, giving API consumers best in class output for most text and code tasks
What it does
Messages API
The core endpoint for generating text. Send a conversation of user and assistant messages, receive Claude's response. Supports streaming, system prompts, stop sequences, and temperature control.
Learn moreTool Use (Function Calling)
Define tools with JSON schemas and Claude will decide when and how to call them. Supports auto, any, and specific tool selection modes. Now generally available. The foundation for building AI agents.
Learn moreVision (Image and PDF Input)
Send images (JPEG, PNG, GIF, WebP) and PDFs directly in messages. Claude can analyze charts, read documents, describe images, extract data from screenshots, and reason about visual content.
Learn moreExtended Thinking
Enable deep, multi step reasoning by giving Claude a thinking budget. Claude reasons through complex problems internally before producing its final answer, dramatically improving accuracy on hard tasks.
Learn moreComputer Use
Claude can see a screen, move the mouse, click buttons, and type text. Build automation that controls any application through its visual interface, from form filling to multi app workflows.
Learn morePrompt Caching
Cache large system prompts, documents, or tool definitions to reduce costs by up to 90% on repeated requests. Supports 5 minute (default) and 1 hour cache durations. Automatic caching is now also available for repeated context.
Learn moreBatch API
Submit up to 100,000 requests as a batch for asynchronous processing with a 50% discount on all tokens. Ideal for data processing, evaluations, and classification at scale.
Learn moreWeb Search and Web Fetch
Server side tools that let Claude search the web ($10 per 1,000 searches) and fetch content from any URL (no additional charge beyond tokens). Now generally available. Give your applications access to real time information.
Code Execution
Run Python code in a sandboxed environment for data analysis, calculations, and file processing. Now generally available. Free when used with web search or web fetch; otherwise billed at $0.05 per hour per container.
Model Context Protocol (MCP)
Anthropic created MCP, the open standard for AI tool integration. Build MCP servers to connect Claude to databases, APIs, file systems, and any external service with a standardized protocol.
Learn moreStreaming
Server sent events for real time token by token output. Essential for responsive user interfaces and long running generations.
Citations
Claude can provide source citations that reference specific passages in the documents you provide, enabling verifiable and traceable AI responses.
Adaptive Thinking
Available on Opus 4.6 and Sonnet 4.6. Claude automatically calibrates its reasoning depth to the complexity of each request, balancing speed and quality without manual configuration.
Fast Mode
2.5x faster output from Opus 4.6 at 6x standard pricing ($30/$150 per MTok). Ideal for latency sensitive applications that need the most capable model. Now generally available.
1M Context Window (GA)
1 million token context window is now generally available on Opus 4.6 and Sonnet 4.6 at standard pricing. Process entire codebases, lengthy documents, or extended conversation histories in a single request.
Automatic Caching
Anthropic now automatically caches repeated context across API requests, reducing costs for workloads with shared prefixes without requiring explicit cache control headers.
Pricing
| Model | Input / 1M tokens | Output / 1M tokens |
|---|---|---|
| Claude Opus 4.6Most intelligent model, launched February 2026. 1M context (GA at standard pricing). 128K max output. Extended thinking, adaptive thinking, fast mode (2.5x faster, 6x pricing). | $5.00 | $25.00 |
| Claude Sonnet 4.6Best balance of intelligence and speed, launched February 2026. 1M context (GA at standard pricing). 64K max output. Extended thinking, adaptive thinking. | $3.00 | $15.00 |
| Claude Haiku 4.5Fastest, most cost efficient. 200K context. 64K max output. Extended thinking. | $1.00 | $5.00 |
| Claude Opus 4.5 (legacy)Previous generation Opus. Same pricing as 4.6. | $5.00 | $25.00 |
| Claude Sonnet 4.5 (legacy)Previous generation Sonnet. Same pricing as 4.6. | $3.00 | $15.00 |
| Claude Opus 4.1 (legacy)Higher priced legacy model. | $15.00 | $75.00 |
| Claude Sonnet 3.7 (legacy, retiring)Being retired. Migrate to Sonnet 4.6 for continued support. | $3.00 | $15.00 |
| Claude Haiku 3.5 (legacy, retiring)Being retired. Migrate to Haiku 4.5 for continued support. | $0.80 | $4.00 |
| Claude Haiku 3 (legacy)Most affordable legacy model. | $0.25 | $1.25 |
Pros & Cons
Pros
- Claude models consistently lead on writing quality, instruction following, and nuanced reasoning, giving API consumers best in class output for most text and code tasks
- Comprehensive tool use system with auto, any, and specific tool selection modes, plus server side tools (web search, web fetch, code execution) that run without client infrastructure
- Anthropic created MCP (Model Context Protocol), the emerging open standard for AI tool integration, and Claude's API is the most deeply integrated with it
- Prompt caching can reduce costs by up to 90% for repeated context, and the Batch API provides a flat 50% discount for async workloads
- 1M token context window (roughly 2,500 pages) on Opus and Sonnet, now generally available at standard pricing since March 2026, with up to 128K token output on Opus 4.6
- Extended thinking dramatically improves accuracy on complex reasoning (from roughly 50% to 90%+ on hard benchmarks) and is available on all current models
- Official SDKs for Python, TypeScript, Java, and Go with excellent documentation and a well designed, consistent API surface
- Available on three major cloud platforms (AWS Bedrock, Google Vertex AI, Microsoft Foundry) for teams that need provider billing or regional data residency
Cons
- No image or video generation capability. If you need multimedia generation, you will need a separate API (OpenAI, Google, Stability, etc.)
- Rate limits can be restrictive at lower usage tiers, especially for Opus 4.6. Scaling to Tier 3+ requires sustained spending over time
- Legacy Opus models (4.1 and 4) are priced at $15/$75 per MTok, which is significantly more expensive than current generation models
- Haiku 4.5 is limited to 200K context, while Opus and Sonnet get the full 1M
- No fine tuning or model customization is available. You must achieve your desired behavior through prompting, system instructions, and tool definitions
- Fast mode for Opus 4.6 delivers 2.5x faster output but carries a steep 6x pricing premium ($30/$150 per MTok), making it expensive for high throughput use cases
- Web search costs $10 per 1,000 searches in addition to token costs, which can add up quickly in search heavy applications
How to get started
Create an account and get your API key
Sign up at the Claude Developer Console. Navigate to API Keys and generate your first key. New accounts receive free credits for testing.
Install an official SDK
Install the SDK for your language: pip install anthropic (Python), npm install @anthropic-ai/sdk (TypeScript/Node), or use the Java/Go SDKs. Set your API key as the ANTHROPIC_API_KEY environment variable.
Make your first API call
Use the Messages API to send a conversation and receive a response. Start with claude-sonnet-4-6 for a good balance of speed and quality, then upgrade to claude-opus-4-6 for complex tasks or downgrade to claude-haiku-4-5 for speed.
Explore the Workbench
Use the Workbench in the Developer Console to prototype prompts, test tool definitions, and compare model outputs before writing code. The prompt generator can help you craft effective system prompts.
Add tools and features
Experiment with tool use (function calling), vision (image/PDF input), extended thinking for complex reasoning, and streaming for real time output. Each feature is opt in and works with all models.
Optimize costs and scale
Enable prompt caching for repeated context (up to 90% savings), use the Batch API for async workloads (50% discount), and choose the right model for each task. Monitor usage in the Developer Console.
Deep dive
Detailed guides with comparisons, tips, and visuals for each feature.
Core API: Messages, Tools, and Vision
The foundational API endpoints and capabilities that power every Claude integration, from simple chat to complex multi tool agents.
Advanced Features: Extended Thinking, Computer Use, and More
The capabilities that set the Anthropic API apart: deep reasoning, autonomous computer control, and adaptive intelligence.
Cost Optimization: Caching, Batching, and Model Selection
How to reduce API costs by up to 90% using prompt caching, the Batch API, and strategic model selection.
Model Context Protocol (MCP): The Open Standard for AI Tool Integration
Anthropic created MCP, the open standard for connecting AI models to tools and data sources. Here is how it works and why it matters.
Anthropic API vs. OpenAI API vs. Google Gemini API
Head to head comparison of the three major AI APIs across pricing, features, models, and strengths.
Links
Similar Tools
Claude
anthropic
chatbotAnthropic's AI assistant for conversations, writing, analysis, coding, and creative work.
Claude Code
anthropic
codingAnthropic's autonomous coding agent that lives in your terminal and understands your entire codebase.
Firecrawl
firecrawl
apiTurn websites into LLM-ready data. API for scraping, crawling, searching, and extracting structured content from any URL, purpose built for AI applications.
Get notified about updates
We'll email you when this tool's pricing or features change.
Last updated: 2026-03-24