Anthropic API
Claude API integration - Access Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Haiku through UniterRouter. Native Anthropic SDK support with tool use and vision capabilities.
Anthropic API
Access Claude models through UniterRouter with full Anthropic API compatibility. Supports both native Anthropic SDK and OpenAI-compatible format.
Two API Formats: UniterRouter supports both the native Anthropic Messages API (/v1/messages) and OpenAI-compatible Chat Completions API (/v1/chat/completions). Choose based on your SDK preference.
Quick Start
import anthropic
client = anthropic.Anthropic(
api_key="your_uniterouter_api_key",
base_url="https://api.uniterouter.ai"
)
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}]
)
print(message.content[0].text)from openai import OpenAI
client = OpenAI(
base_url="https://api.uniterouter.ai/v1",
api_key="your_uniterouter_api_key",
)
response = client.chat.completions.create(
model="claude-sonnet-4-20250514",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)curl https://api.uniterouter.ai/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: $UNITEROUTER_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello!"}
]
}'Available Claude Models
| Model | Description | Context | Max Output |
|---|---|---|---|
claude-sonnet-4-20250514 | Latest Claude 4 Sonnet | 200K | 64K |
claude-opus-4-20250514 | Most powerful Claude 4 | 200K | 32K |
claude-3-7-sonnet-20250219 | Claude 3.7 Sonnet with extended thinking | 200K | 128K |
claude-3-5-sonnet-20241022 | Claude 3.5 Sonnet | 200K | 8K |
claude-3-5-haiku-20241022 | Fast and affordable | 200K | 8K |
claude-3-opus-20240229 | Claude 3 Opus | 200K | 4K |
claude-3-haiku-20240307 | Previous Haiku | 200K | 4K |
Features
All Claude features are supported:
- Streaming: Real-time response streaming
- Vision: Image input with base64 or URL
- Tool Use: Function calling with structured outputs
- Extended Thinking: Deep reasoning with Claude 3.7+
- System Prompts: Via system message or parameter
- PDF Support: Document analysis (Claude 3.5+)
SDK Installation
pip install anthropicpip install openaiAPI Endpoints
| Endpoint | Format | Description |
|---|---|---|
POST /v1/messages | Anthropic native | Messages API |
POST /v1/chat/completions | OpenAI compatible | Chat Completions |
Related
- Messages API - Native Anthropic API documentation
- Chat Completions API - OpenAI-compatible endpoint
How is this guide?
Models GET
List LLM Models API - Discover 200+ available AI models including GPT-4, Claude, Gemini, DeepSeek. Get model capabilities, pricing, and context limits through UniterRouter.
Messages POST
Claude API Messages endpoint - Create Claude 3.5 Sonnet, Claude 3 Opus conversations through UniterRouter. Anthropic-compatible API with streaming and tool use support.