Claude Sonnet 4

Claude Sonnet 4 significantly enhances the capabilities of its predecessor, Sonnet 3.7, excelling in both coding and reasoning tasks with improved precision and controllability. Achieving state-of-the-art performance on SWE-bench (72.7%), Sonnet 4 balances capability and computational efficiency, making it suitable for a broad range of applications from routine coding tasks to complex software development projects. Key enhancements include improved autonomous codebase navigation, reduced error rates in agent-driven workflows, and increased reliability in following intricate instructions. Sonnet 4 is optimized for practical everyday use, providing advanced reasoning capabilities while maintaining efficiency and responsiveness in diverse internal and external scenarios. Read more at the [blog post here](https://www.anthropic.com/news/claude-4)

ChatAnthropic1M tokens$3.2702 / $16.3509 · 1M

anthropic/claude-sonnet-4

Context
1M tokens
Completion cap
64,000
Tools
Yes
JSON
No
Released
2025-05-22

Call it from Geek Hub

Same OpenAI SDK. Change the base URL and the model id.

curl https://api.geekhub.mx/v1/chat/completions \
  -H "Authorization: Bearer $GEEKHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-4",
    "messages": [{"role": "user", "content": "Hola"}]
  }'
Get an API key

Frequently asked questions

What is Claude Sonnet 4?
Claude Sonnet 4 significantly enhances the capabilities of its predecessor, Sonnet 3.7, excelling in both coding and reasoning tasks with improved precision and controllability. Achieving state-of-the-art performance on SWE-bench (72.7%), Sonnet 4 balances capability and computational efficiency, making it suitable for a broad range of applications from routine coding tasks to complex software development projects. Key enhancements include improved autonomous codebase navigation, reduced error rates in agent-driven workflows, and increased reliability in following intricate instructions. Sonnet 4 is optimized for practical everyday use, providing advanced reasoning capabilities while maintaining efficiency and responsiveness in diverse internal and external scenarios. Read more at the [blog post here](https://www.anthropic.com/news/claude-4) Claude Sonnet 4 runs on the Geek Hub API (OpenAI-compatible). Model id: anthropic/claude-sonnet-4.
Is Claude Sonnet 4 free?
No. Input is $3.2702 per 1M tokens and output is $16.3509 per 1M tokens on Geek Hub (markup included).
What is the context length of Claude Sonnet 4?
Claude Sonnet 4 has a 1M tokens context window. It supports up to 64,000 completion tokens.
Does Claude Sonnet 4 support tool calling and structured outputs?
Claude Sonnet 4 accepts tools and tool_choice for function calling. Structured outputs are not listed for this endpoint.
When was Claude Sonnet 4 released?
Claude Sonnet 4 was released on 2025-05-22.

More models from Anthropic