claude-sonnet-4-6 API
Build text-and-image chat workflows with claude-sonnet-4-6 on APISea, with tool use and extended thinking.
claude-sonnet-4-6تسعير API لنموذج claude-sonnet-4-6
جميع الأسعار بالدولار الأمريكي (USD). مقارنة أسعار APISea بالسعر الرسمي المعلن للوحدة نفسها.
| نوع الـ token | APISea | رسمي | وفّر |
|---|---|---|---|
| الإدخال لكل 1M رمز | $2.64 | $3.00 | −12% |
| الإدخال المخزّن مؤقتًا لكل 1M رمز | $0.264 | $0.30 | −12% |
| الكتابة في ذاكرة التخزين المؤقت (5 دقائق) لكل 1M رمز | $3.30 | $3.75 | −12% |
| الكتابة في ذاكرة التخزين المؤقت (ساعة واحدة) لكل 1M رمز | $5.28 | $6.00 | −12% |
| الإخراج لكل 1M رمز | $13.20 | $15.00 | −12% |
ما هو claude-sonnet-4-6؟
Anthropic’s claude-sonnet-4-6 is the balanced version in the Claude Sonnet family, available through APISea for chat applications. It supports text and image inputs, multi-turn conversations, and generated text responses. Developers can build assistants that work with supplied documents, discuss images, or use defined tools. The native Claude Messages interface supports extended thinking, SSE streaming, system instructions, and controls for sampling and stopping generation. Maximum input is 1,000,000 tokens, with up to 128,000 output tokens.
APISea provides access through one API key, with an OpenAI-compatible base URL at https://api.apisea.ai/v1 and a native Anthropic Messages endpoint. Billing is pay-as-you-go and applies only to successful requests. Input costs $2.64 per 1M tokens and output costs $13.20 per 1M tokens. Prompt-cache reads and writes have separate rates, with 5-minute and 1-hour write options. The default configuration is about 12% below the provider list price.
أبرز مزايا claude-sonnet-4-6
Text and Image Inputs
Work with multimodal content including text and images, and maintain multi-turn conversations.
Extended Thinking Controls
Configure extended thinking through the thinking parameter on the native Messages endpoint. Responses may include thinking blocks when enabled.
Tools and Streaming
Define tools and control tool selection through tools and tool_choice. Enable stream to receive responses through Server-Sent Events.
Prompt Cache Support
Supports prompt-cache reads and cache writes. APISea offers separate cache-write pricing for 5-minute and 1-hour TTLs.
كيفية استدعاء API الخاص بـ claude-sonnet-4-6 في 4 خطوات
- 01
احصل على API key
سجّل الدخول إلى APISea، واشحن رصيدك بدءًا من $50، وأنشئ مفتاح sk-sea من وحدة التحكم.
- 02
اضبط عنوان URL الأساسي
استخدم https://api.apisea.ai/v1 عنوانًا أساسيًا في SDK أو عميل HTTP.
- 03
أرسل الطلب
استدعِ POST /v1/chat/completions مع "model": "claude-sonnet-4-6" والمعلمات أدناه.
- 04
تعامل مع الاستجابة
اقرأ الاستجابة (أو استقبل الـ tokens بالتدفق باستخدام stream: true). يظهر الاستخدام والتكلفة في وحدة التحكم.
أمثلة على الطلبات
الوثائق: Claude Messages APIcurl https://api.apisea.ai/v1/chat/completions \
-H "Authorization: Bearer $APISEA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-6",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Explain what an AI API gateway does in two sentences."}
],
"stream": false
}'المعلمات
| المعلمة | النوع | مطلوب | افتراضي | الوصف |
|---|---|---|---|---|
model | string | مطلوب | claude-sonnet-4-6 | Model name |
messages | array | مطلوب | — | List of messages |
role | string | مطلوب | user | Role type |
content | string | مطلوب | — | Message content |
max_tokens | integer | مطلوب | — | Maximum tokens to generate (**required**, same as Anthropic official) |
thinking | object | اختياري | — | Extended thinking configuration |
system | string | array | اختياري | — | System prompt |
temperature | number | اختياري | — | Temperature parameter, range 0-1 |
top_p | number | اختياري | — | Nucleus sampling parameter, range 0-1 |
top_k | integer | اختياري | — | Top-K sampling |
stream | boolean | اختياري | — | Enable streaming |
stop_sequences | array | اختياري | — | Stop sequences |
metadata | object | اختياري | — | Metadata |
tools | array | اختياري | — | Tool definitions |
tool_choice | object | اختياري | — | Tool choice strategy |
ما الذي يمكنك إنشاؤه باستخدام claude-sonnet-4-6
Document-based assistants
Build chat workflows that answer questions about supplied text and retain conversation history across turns.
Image discussion workflows
Let users submit images alongside text for image-focused questions and conversational follow-up.
Tool-connected assistants
Define custom function tools for assistants that interact with your application's functions and workflows.
Reasoning-focused workflows
Enable extended thinking for tasks that benefit from deliberate analysis, then stream the response to your application.
نصائح للحصول على نتائج أفضل
- 01
Set the output budget
The native Messages endpoint requires max_tokens. Choose a budget appropriate to the task; the model may stop before reaching it.
- 02
Choose a sampling control
For the native Messages endpoint, temperature and top_p range from 0 to 1. The documentation recommends using either temperature or top_p, not both.
- 03
Plan cache usage
Cache reads cost $0.264 per 1M tokens. Cache writes cost $3.30 per 1M tokens for a 5-minute TTL or $5.28 per 1M tokens for a 1-hour TTL; account for write costs when planning reuse.
- 04
Preserve thinking signatures
Use the standard model ID with the thinking parameter rather than platform-side thinking aliases. If you pass thinking blocks back in a multi-turn conversation, preserve their signature unchanged.
القيود ومعلومات مهمة
Maximum input is 1,000,000 tokens, and maximum output is 128,000 tokens.
The native Messages endpoint requires max_tokens and permits at most four stop sequences.
Inference responses from /v1/messages are upstream passthrough, not wrapped in a code/data object.
الأسئلة الشائعة حول API الخاص بـ claude-sonnet-4-6
How much does claude-sonnet-4-6 cost on APISea?
Input costs $2.64 per 1M tokens and output costs $13.20 per 1M tokens. The default configuration is about 12% below the provider list price, with pay-as-you-go billing only for successful requests.
How do I call claude-sonnet-4-6 through APISea?
Set model to claude-sonnet-4-6 and send requests to POST /v1/chat/completions using the OpenAI-compatible base URL https://api.apisea.ai/v1. For the native Anthropic protocol, use POST /v1/messages with either x-api-key or Bearer authentication.
Does claude-sonnet-4-6 support prompt caching?
Yes, it supports prompt-cache reads and writes. Cache reads cost $0.264 per 1M tokens; cache writes cost $3.30 per 1M tokens for a 5-minute TTL or $5.28 per 1M tokens for a 1-hour TTL.
What parameters and capabilities does the native Messages API support?
It supports system instructions, extended thinking, tools, tool_choice, SSE streaming, and text-and-image content. Supply model, messages, and max_tokens; sampling controls include temperature, top_p, and top_k.
What are the token limits for claude-sonnet-4-6?
Maximum input is 1,000,000 tokens, and maximum output is 128,000 tokens. Set max_tokens to control the generation budget; the model may finish before that limit.
Can I use claude-sonnet-4-6 commercially?
Commercial use is subject to the provider's terms. Review Anthropic's applicable terms and APISea's terms before deploying your application.
نماذج ذات صلة
claude-sonnet-4-5
claude-sonnet-4-5-20250929
claude-sonnet-4-5-20250929-thinking
claude-sonnet-4-6-thinking
claude-sonnet-5
claude-sonnet-5-5
claude-fable-5
claude-fable-5.1
ابدأ التطوير باستخدام claude-sonnet-4-6
مفتاح واحد، وادفع حسب الاستخدام بدءًا من $50؛ ولا تُحتسب الرسوم إلا على الطلبات الناجحة.