Skip to content
הדף עדיין אינו זמין בשפה שלכם, ולכן הוא מוצג באנגלית.
Anthropic · Claude Sonnet

claude-sonnet-4-5 API

Build chat, image-aware workflows, and tool-enabled applications with claude-sonnet-4-5 on APISea.

צ'אטצ'אט וטקסטסינכרונישמירת הנחיות במטמון
מזהה מודל
claude-sonnet-4-5

תמחור API של claude-sonnet-4-5

כל המחירים נקובים ב-USD. תעריפי APISea בהשוואה למחירון הרשמי עבור אותה יחידה.

סוג tokenAPISeaרשמיחיסכון
קלט לכל 1M tokens$2.64$3.00−12%
קלט שמור במטמון לכל 1M tokens$0.264$0.30−12%
כתיבה למטמון (5 דקות) לכל 1M tokens$3.30$3.75−12%
כתיבה למטמון (שעה) לכל 1M tokens$5.28$6.00−12%
פלט לכל 1M tokens$13.20$15.00−12%

מהו claude-sonnet-4-5?

Anthropic’s claude-sonnet-4-5 is a Claude Sonnet chat model for conversational applications, document workflows, and tool-enabled assistants. It supports text and image inputs, multi-turn conversations, and generated text responses. Through the native Claude Messages protocol, developers can configure extended thinking, define tools, set system instructions, and stream responses with Server-Sent Events. The model allows up to 200,000 input tokens and 64,000 output tokens, giving developers room for substantial source material and longer responses.

APISea provides access through one API key and the OpenAI-compatible base URL https://api.apisea.ai/v1, with native Claude Messages access also available. 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 cache-write options. The default configuration is about 12% below the provider list price.

המאפיינים הבולטים של claude-sonnet-4-5

Text and Image Inputs

Use text and images as input for conversations and image-aware workflows through the Claude Messages API.

Large Token Limits

Work with up to 200,000 input tokens and generate up to 64,000 output tokens. Set your response budget with max_tokens.

Tools and Thinking

The native Messages API supports tool definitions, tool-choice controls, and extended thinking configuration.

Prompt Cache Support

Cache reads cost $0.264 per 1M tokens. Cache writes are available with 5-minute and 1-hour TTL options.

איך לקרוא ל-API של claude-sonnet-4-5 ב-4 שלבים

  1. 01

    יצירת מפתח API

    יש להתחבר ל-APISea, להוסיף יתרה החל מ-$50 וליצור מפתח sk-sea במסוף.

  2. 02

    הגדרת כתובת הבסיס

    יש להשתמש ב-https://api.apisea.ai/v1 ככתובת הבסיס ב-SDK או בלקוח HTTP.

  3. 03

    שליחת הבקשה

    יש לקרוא ל-POST /v1/chat/completions עם "model": "claude-sonnet-4-5" והפרמטרים שלהלן.

  4. 04

    טיפול בתגובה

    יש לקרוא את התגובה (או להזרים tokens באמצעות stream: true). נתוני השימוש והעלות מופיעים במסוף.

דוגמאות לבקשות

תיעוד: Claude Messages API
curl https://api.apisea.ai/v1/chat/completions \
  -H "Authorization: Bearer $APISEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-5",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "Explain what an AI API gateway does in two sentences."}
    ],
    "stream": false
  }'

פרמטרים

פרמטרסוגנדרשברירת מחדלתיאור
modelstringנדרשclaude-sonnet-4-6Model name
messagesarrayנדרש—List of messages
rolestringנדרשuserRole type
contentstringנדרש—Message content
max_tokensintegerנדרש—Maximum tokens to generate (**required**, same as Anthropic official)
thinkingobjectאופציונלי—Extended thinking configuration
systemstring | arrayאופציונלי—System prompt
temperaturenumberאופציונלי—Temperature parameter, range 0-1
top_pnumberאופציונלי—Nucleus sampling parameter, range 0-1
top_kintegerאופציונלי—Top-K sampling
streambooleanאופציונלי—Enable streaming
stop_sequencesarrayאופציונלי—Stop sequences
metadataobjectאופציונלי—Metadata
toolsarrayאופציונלי—Tool definitions
tool_choiceobjectאופציונלי—Tool choice strategy

מה אפשר לבנות עם claude-sonnet-4-5

Document Question Answering

Build assistants that answer questions using supplied documents and conversation history, with room for substantial reference material.

Image-Aware Assistance

Let users submit images alongside text questions to create assistants that discuss visual input.

Tool-Enabled Workflows

Define custom function tools for assistants that connect conversations to application actions and external data.

Streaming Chat Interfaces

Build multi-turn chat experiences that display generated responses incrementally using SSE streaming.

טיפים לקבלת תוצאות טובות יותר

  • 01

    Set the Model Explicitly

    Specify claude-sonnet-4-5 in each request rather than relying on the endpoint default. The model is also callable as claude-sonnet-4-5-20250929.

  • 02

    Budget Your Output

    The native Messages API requires max_tokens. Set it to fit the task, within the 64,000-token output maximum; the model may stop before reaching it.

  • 03

    Plan Cache Usage

    Account for separate cache-read and cache-write charges. A 5-minute cache write costs $3.30 per 1M tokens, while a 1-hour cache write costs $5.28 per 1M tokens.

  • 04

    Preserve Thinking Signatures

    Use the thinking parameter with the standard model name for extended thinking. If you pass thinking blocks back in a multi-turn conversation, preserve their signature unchanged to avoid upstream rejection.

מגבלות ודברים שכדאי לדעת

  • Maximum input is 200,000 tokens, and maximum output is 64,000 tokens.

  • The native Claude Messages API requires max_tokens and uses a separate system parameter for system prompts.

  • Inference responses from /v1/messages are upstream passthrough, not wrapped in {code, data}.

שאלות נפוצות על API של claude-sonnet-4-5

How much does claude-sonnet-4-5 cost on APISea?

Input costs $2.64 per 1M tokens and output costs $13.20 per 1M tokens. Cached input costs $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. The default configuration is about 12% below provider list price, with billing only for successful requests.

How do I call claude-sonnet-4-5 through APISea?

Use the OpenAI-compatible POST /v1/chat/completions endpoint with Bearer authentication and model set to claude-sonnet-4-5. For the native Claude Messages protocol, use POST /v1/messages with either x-api-key or Bearer authentication, and include model, messages, and max_tokens.

Does claude-sonnet-4-5 support images, tools, and extended thinking?

The Claude Messages API supports text and image content, tool use, and extended thinking. Configure tools with tools and tool_choice, and extended thinking with the thinking parameter.

What are the input and output token limits?

The model supports a maximum input of 200,000 tokens and a maximum output of 64,000 tokens. The max_tokens parameter sets the generation ceiling, but a response may finish earlier.

Can I stream responses and control generation?

Yes—set stream to true on the native Messages API to receive SSE responses. That API also exposes temperature from 0–1, top_p, top_k, and stop_sequences; its documentation recommends using either temperature or top_p, not both.

Can I use claude-sonnet-4-5 commercially?

Commercial use is subject to the provider's terms. Review Anthropic’s applicable terms and APISea’s terms for your intended application.

מודלים קשורים

עומק: יותר מ-250 מודלים · טעינת יתרה מינימלית $50

מתחילים לבנות עם claude-sonnet-4-5

מפתח אחד, תשלום לפי שימוש החל מ-$50, וחיוב רק על בקשות שהצליחו.