The Anthropic API gives developers access to Claude, one of the most capable large language models available.
What is the Anthropic API?
The Anthropic API allows you to integrate Claude into your applications. Build chatbots, content generators, code assistants, and more using Claude’s capabilities.
Available Models
Claude 3.5 Sonnet
- Best balance of speed and capability
- Ideal for most applications
- $3/million input, $15/million output tokens
Claude 3 Opus
- Most capable model
- Best for complex reasoning
- $15/million input, $75/million output tokens
Claude 3 Haiku
- Fastest model
- Best for simple tasks
- $0.25/million input, $1.25/million output tokens
Key Features
Massive Context
200,000 tokens means you can:
- Process entire codebases
- Analyze long documents
- Maintain extended conversations
Tool Use
Claude can use tools:
- Call functions
- Access databases
- Execute code
- Interact with APIs
Vision
Analyze images:
- Understand diagrams
- Read documents
- Describe photos
Getting Started
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-3-5-sonnet-20241022",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello, Claude"}
]
)
print(message.content)
Pricing
| Model | Input | Output |
|---|---|---|
| Haiku | $0.25/M | $1.25/M |
| Sonnet | $3/M | $15/M |
| Opus | $15/M | $75/M |
Best Use Cases
Enterprise Applications
Build production-grade AI features with reliable infrastructure.
Content Generation
Create high-quality written content at scale.
Code Assistance
Power coding tools with Claude’s strong programming abilities.
Document Analysis
Process and understand large documents.
API vs ChatGPT Plus
| Feature | Anthropic API | Claude Pro |
|---|---|---|
| Use case | Building apps | Personal use |
| Pricing | Per token | $20/month |
| Customization | Full | Limited |
| Rate limits | Higher | Lower |