# Claude Sonnet 4 - Core.Today AI API > 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. - **Provider**: Anthropic - **Model ID**: claude-sonnet-4 - **Category**: LLM - **Credits**: 3 per 1K tokens (avg) - **Speed**: Fast - **Quality**: High ## Model Specifications - **Context Window**: 200K tokens - **Max Output**: 16K tokens - **Training Cutoff**: 2025-03 - **Supported Formats**: text, markdown, xml - **Compatible SDK**: Anthropic ### Capabilities - Vision (image input) - Function Calling - Streaming - System Prompt ### Token Pricing (per 1M tokens) - **Input Tokens**: 5,574 credits ($3.72) - **Output Tokens**: 27,870 credits ($18.58) - **Cached Tokens**: 557.4 credits ($0.37) ## Features - 200K context window - 16K max output tokens - Vision capabilities - Function calling & tool use - Balanced speed and intelligence - Streaming support ## Use Cases - Production chatbots - Code generation and review - Document analysis - Data extraction - Content generation - Workflow automation ## API Endpoint Base URL: https://api.core.today Endpoint: POST /llm/anthropic/v1/messages ## Authentication Header: Authorization: Bearer YOUR_API_KEY Note: LLM endpoints use OpenAI-compatible format with Authorization Bearer token. ## Input Parameters ### Required - **messages**: array - Array of message objects with role and content - **model**: string (default: claude-sonnet-4) - Model identifier - **max_tokens**: integer - Maximum tokens in response (required, up to 16384) ### Optional - **temperature**: float (default: 1.0) - Sampling temperature (0-1) - **stream**: boolean (default: false) - Enable streaming responses - **system**: string - System prompt for setting behavior - **top_p**: float (default: 0.999) - Nucleus sampling parameter (0-1) ## Examples ### General Conversation Balanced conversation with Claude Sonnet 4 ```json { "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 ```json { "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 } ``` ## Response Format ```json { "id": "chatcmpl-abc123", "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Response text here" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 100, "completion_tokens": 50, "total_tokens": 150 } } ``` ## Tips - Good balance of cost and capability for production use - max_tokens is required - always specify it - Use system prompt for persona and constraints - Temperature max is 1.0 (not 2.0 like OpenAI) - Consider Sonnet 4.5 for tasks needing higher intelligence - Great for high-volume production workloads ## Documentation https://docs.anthropic.com/en/docs/about-claude/models