Claude 4 Sonnet
Approved Data Classifications
Description
Claude Sonnet 4 is Anthropic’s latest hybrid-reasoning model that seamlessly switches between rapid standard responses and an extended thinking mode for visible step-by-step reasoning, supports a 200 K-token context window with low hallucination rates ideal for processing long documents and codebases , demonstrates a state-of-the-art 72.7 % on the SWE-bench coding benchmark while reducing reward hacking by up to eight times compared to its predecessor, retains the same cost-effective pricing of $3 per million input tokens and $15 per million output tokens, offers multimodal capabilities such as extracting information from charts and diagrams, and is accessible on all paid Claude plans via the Anthropic API, Amazon Bedrock, and Google Cloud’s Vertex AI.
Capabilities
Model | Training Data | Input | Output | Context Length | Cost (per 1 million tokens) |
---|---|---|---|---|---|
claude-4-sonnet | August 2023 | Image , Text | Text | 200,000 | $3.00/1M input $15.00/1M output |
1M
represents 1 Million Tokens- All prices listed are based on 1 Million Tokens
Availability
Cloud Provider
Usage
- curl
- python
- javascript
curl -X POST https://api.ai.it.ufl.edu/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_TOKEN>" \
-d '{
"model": "claude-4-sonnet",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a haiku about an Alligator."
}
]
}'
from openai import OpenAI
client = OpenAI(
api_key="your_api_key",
base_url="https://api.ai.it.ufl.edu/v1"
)
response = client.chat.completions.create(
model="claude-4-sonnet", # model to send to the proxy
messages = [
{ role: "system", content: "You are a helpful assistant." },
{
"role": "user",
"content": "Write a haiku about an Alligator."
}
]
)
print(response.choices[0].message)
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: 'your_api_key',
baseURL: 'https://api.ai.it.ufl.edu/v1'
});
const completion = await openai.chat.completions.create({
model: "claude-4-sonnet",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{
role: "user",
content: "Write a haiku about an Alligator.",
},
],
});
print(completion.choices[0].message)
When to use
- Cost-sensitive coding and development workflows
- Long-form contexts without breaking the bank
- Agentic subagent in automated pipelines
- Balanced speed and depth
- Visual data extraction and analysis
- General-purpose chatbots and content generation
References
- Anthropic
https://www.anthropic.com- LLM Stats
https://llm-stats.com- Artificial Analysis
https://artificialanalysis.ai