Skip to main content
Core.Today
|
AnthropicFastHigh

Claude Sonnet 4

Balanced Sonnet 4 model offering strong reasoning and coding abilities at an efficient price point. Ideal for everyday production workloads that need a good mix of speed and intelligence.

3 credits
per 1K tokens (avg)
200K context window
16K max output tokens
Vision capabilities
Function calling & tool use
Balanced speed and intelligence
Streaming support

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

llms.txt

Model Specifications

Context Window
200K
tokens
Max Output
16K
tokens
Training Cutoff
2025-03
Compatible SDK
Anthropic

Capabilities

Vision
Function Calling
Streaming
JSON Mode
System Prompt

Token Pricing (per 1M tokens)

Token TypeCreditsUSD Equivalent
Input Tokens6,000$6.00
Output Tokens30,000$30.00
Cached Tokens600$0.60

* 1 credit β‰ˆ $0.001 (actual charges may vary based on usage)

Quick Start

curl -X POST "https://api.core.today/llm/anthropic/v1/messages" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cdt_your_api_key" \
  -d '{
  "model": "claude-sonnet-4",
  "max_tokens": 2000,
  "system": "You are a helpful assistant that provides clear and concise answers.",
  "messages": [
    {
      "role": "user",
      "content": "Explain the key differences between microservices and monolithic architecture, with pros and cons of each."
    }
  ]
}'

Parameters

ParameterTypeRequiredDefaultDescription
messagesarrayYes-Array of message objects with role and content
modelstringYesclaude-sonnet-4Model identifier
temperaturefloatNo1.0Sampling temperature (0-1)
max_tokensintegerYes-Maximum tokens in response (required, up to 16384)
streambooleanNofalseEnable streaming responses
systemstringNo-System prompt for setting behavior
top_pfloatNo0.999Nucleus sampling parameter (0-1)

Examples

General Conversation

Balanced conversation with Claude Sonnet 4

curl -X POST "https://api.core.today/llm/anthropic/v1/messages" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cdt_your_api_key" \
  -d '{
  "model": "claude-sonnet-4",
  "max_tokens": 2000,
  "system": "You are a helpful assistant that provides clear and concise answers.",
  "messages": [
    {
      "role": "user",
      "content": "Explain the key differences between microservices and monolithic architecture, with pros and cons of each."
    }
  ]
}'

Code Review

Review and improve code

curl -X POST "https://api.core.today/llm/anthropic/v1/messages" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cdt_your_api_key" \
  -d '{
  "model": "claude-sonnet-4",
  "max_tokens": 3000,
  "messages": [
    {
      "role": "user",
      "content": "Review this Python function for bugs, performance issues, and suggest improvements:\n\ndef process_data(items):\n    result = []\n    for item in items:\n        if item not in result:\n            result.append(item)\n    return sorted(result)"
    }
  ],
  "temperature": 0.3
}'

Tips & Best Practices

1Good balance of cost and capability for production use
2max_tokens is required - always specify it
3Use system prompt for persona and constraints
4Temperature max is 1.0 (not 2.0 like OpenAI)
5Consider Sonnet 4.5 for tasks needing higher intelligence
6Great for high-volume production workloads

Use Cases

Production chatbots
Code generation and review
Document analysis
Data extraction
Content generation
Workflow automation

Model Info

ProviderAnthropic
Version20250514
CategoryLLM
Price3 credits

API Endpoint

POST /llm/anthropic/v1/messages
Try in PlaygroundBack to Docs