Claude Sonnet 4
Unleash the power of Claude Sonnet 4, a cutting-edge AI model designed for exceptional coding, advanced reasoning, and precise instruction following.
🚀Function Overview
A hybrid reasoning model providing near-instant responses and extended thinking capabilities for coding, analysis, and complex instruction following.
Key Features
- Dual operating modes (standard vs. extended thinking)
- State-of-the-art coding performance (72.7% on SWE-bench)
- Enhanced instruction following and steerability
- Parallel tool execution
- Web search integration during extended thinking
- 65% reduction in shortcut/loophole behavior
Use Cases
- •Coding tasks and development workflows
- •Complex instruction following
- •Multi-file codebase operations
- •Autonomous application development
- •Long-form reasoning and analysis
- •Agent-based workflows
⚙️Input Parameters
prompt
stringInput prompt
image
stringOptional input image. Images are priced as (width px * height px)/750 input tokens
system_prompt
stringSystem prompt
max_tokens
integerMaximum number of output tokens
max_image_resolution
numberMaximum image resolution in megapixels. Scales down image before sending it to Claude, to save time and money.
extended_thinking
booleanWhether to enable extended thinking mode (only supported for Sonnet 3.7 and Sonnet 4)
thinking_budget_tokens
integerMaximum number of tokens to use for extended thinking when enabled (only supported for Sonnet 3.7 and Sonnet 4)
💡Usage Examples
Example 1
Input Parameters
{
"prompt": "Give me a recipe for tasty smashed avocado on sourdough toast that could feed all of California.",
"max_tokens": 8192,
"system_prompt": "You are a helpful assistant",
"max_image_resolution": 0.5
}Output Results
Quick Actions
Technical Specifications
- Hardware Type
- Run Count
- 99.8k
- Commercial Use
- Supported
- Pricing
- Input: $3 per million tokens; Output: $15 per million tokens
- Platform
- Replicate