Claude models with OpenAI-compatible API interface for seamless integration.
Model | Description | Max Tokens | Cost (Input / Output) |
---|---|---|---|
claude-4-opus | Most capable (Opus 4) | 200k | 75/1M output |
claude-4-sonnet | Balanced performance (Sonnet 4) | 200k | 15/1M output |
claude-3.7-sonnet | Sonnet 3.7 (legacy) | 200k | 15/1M output |
claude-3.5-sonnet | Sonnet 3.5 (legacy) | 200k | 15/1M output |
claude-3.5-haiku | Haiku 3.5 (fast, cost-effective) | 200k | 4/1M output |
claude-3-opus-20240229 | Opus 3 (legacy) | 200k | 75/1M output |
claude-3-haiku-20240307 | Haiku 3 (legacy, fast & efficient) | 200k | 1.25/1M output |
Parameter | Type | Default | Description |
---|---|---|---|
model | str | - | Model identifier (required) |
api_key | str | None | API key (uses ANTHROPIC_API_KEY env var) |
base_url | str | https://api.anthropic.com/v1/ | API base URL |
Parameter | Type | Default | Description |
---|---|---|---|
temperature | float | 1.0 | Controls randomness (0.0 = deterministic) |
max_tokens | int | 8192 | Maximum tokens to generate |
top_p | float | 1.0 | Nucleus sampling parameter |
top_k | int | None | Top-k sampling parameter |
user | str | None | User identifier for analytics |
max_tokens=8192
if not specified, unlike OpenAI models.Model | Speed | Capability | Cost | Best For |
---|---|---|---|---|
claude-3-5-sonnet | Fast | High | Medium | General use, complex reasoning |
claude-3-5-haiku | Very Fast | Good | Low | Simple tasks, high volume |
claude-3-opus | Slow | Highest | High | Complex analysis, research |
claude-3-sonnet | Medium | High | Medium | Balanced performance |
claude-3-haiku | Fast | Good | Low | Quick responses, cost-sensitive |
sk-ant-