claude-haiku-4-5 API
Use claude-haiku-4-5 on APISea for chat, text-and-image prompts, tool use, and extended thinking.
claude-haiku-4-5Bảng giá API claude-haiku-4-5
Tất cả giá đều tính bằng USD. So sánh mức giá của APISea với giá niêm yết chính thức cho cùng đơn vị.
| Loại token | APISea | Chính thức | Tiết kiệm |
|---|---|---|---|
| Đầu vào mỗi 1M token | $0.88 | $1.00 | −12% |
| Đầu vào đã lưu trong bộ nhớ đệm mỗi 1M token | $0.088 | $0.10 | −12% |
| Ghi vào bộ nhớ đệm (5 phút) mỗi 1M token | $1.10 | $1.25 | −12% |
| Ghi vào bộ nhớ đệm (1 giờ) mỗi 1M token | $1.76 | $2.00 | −12% |
| Đầu ra mỗi 1M token | $4.40 | $5.00 | −12% |
claude-haiku-4-5 là gì?
claude-haiku-4-5 is an Anthropic chat model in the Claude Haiku family, available through APISea for conversational applications and text-generation workflows. Developers can use it for multi-turn assistants, document summaries, and tool-connected workflows. The documented Claude Messages interface supports text and image content, streaming through Server-Sent Events, tool use, and extended thinking. Controls include a separate system prompt, max_tokens, temperature, top_p, and stop_sequences. The model accepts up to 200,000 input tokens and generates up to 64,000 output tokens.
Call the model through APISea’s OpenAI-compatible chat endpoint or the native-compatible Claude Messages endpoint using your APISea key. Pricing is pay-as-you-go, with billing only for successful requests: input costs $0.88 per 1M tokens and output costs $4.40 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.
Điểm nổi bật của claude-haiku-4-5
Text and Image Prompts
The documented Claude Messages interface supports text and image content, along with multi-turn conversations.
Large Token Limits
Provide up to 200,000 input tokens and generate up to 64,000 output tokens. Set max_tokens to control the requested output budget.
Tools and Thinking
The Claude Messages interface supports tool definitions, tool-choice controls, and extended thinking configuration.
Prompt Cache Options
The model supports prompt-cache reads and cache writes. APISea lists separate cache-write rates for 5-minute and 1-hour TTLs.
Cách gọi API claude-haiku-4-5 trong 4 bước
- 01
Tạo API key
Đăng nhập APISea, nạp tối thiểu $50 rồi tạo key sk-sea trong bảng điều khiển.
- 02
Đặt base URL
Dùng https://api.apisea.ai/v1 làm base URL trong SDK hoặc HTTP client.
- 03
Gửi request
Gọi POST /v1/chat/completions với "model": "claude-haiku-4-5" và các tham số bên dưới.
- 04
Xử lý phản hồi
Đọc phản hồi (hoặc truyền token theo luồng bằng stream: true). Mức sử dụng và chi phí sẽ hiển thị trong bảng điều khiển.
Ví dụ request
Tài liệu: Claude Messages APIcurl https://api.apisea.ai/v1/chat/completions \
-H "Authorization: Bearer $APISEA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-haiku-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
}'Tham số
| Tham số | Loại | Bắt buộc | Mặc định | Mô tả |
|---|---|---|---|---|
model | string | Bắt buộc | claude-sonnet-4-6 | Model name |
messages | array | Bắt buộc | — | List of messages |
role | string | Bắt buộc | user | Role type |
content | string | Bắt buộc | — | Message content |
max_tokens | integer | Bắt buộc | — | Maximum tokens to generate (**required**, same as Anthropic official) |
thinking | object | Tùy chọn | — | Extended thinking configuration |
system | string | array | Tùy chọn | — | System prompt |
temperature | number | Tùy chọn | — | Temperature parameter, range 0-1 |
top_p | number | Tùy chọn | — | Nucleus sampling parameter, range 0-1 |
top_k | integer | Tùy chọn | — | Top-K sampling |
stream | boolean | Tùy chọn | — | Enable streaming |
stop_sequences | array | Tùy chọn | — | Stop sequences |
metadata | object | Tùy chọn | — | Metadata |
tools | array | Tùy chọn | — | Tool definitions |
tool_choice | object | Tùy chọn | — | Tool choice strategy |
Bạn có thể xây dựng gì với claude-haiku-4-5
Conversational Support
Build a multi-turn assistant with system instructions for your support workflow, and stream responses as they are generated.
Document Summaries
Provide source text and ask for summaries, extracted details, or follow-up answers within the model’s input and output limits.
Image-Based Assistance
Use text-and-image prompts through the Claude Messages interface to ask questions about supplied images.
Tool-Connected Workflows
Define tools for an assistant that can request application actions or retrieve information through your own integrations.
Mẹo để có kết quả tốt hơn
- 01
Set an Output Budget
Include max_tokens when using Claude Messages; it is required. Choose a task-appropriate value rather than always requesting the 64,000-token maximum.
- 02
Plan Cache Costs
Cache reads cost $0.088 per 1M tokens. Compare cache-write costs of $1.10 per 1M tokens for a 5-minute TTL and $1.76 per 1M tokens for a 1-hour TTL against your reuse pattern.
- 03
Keep Instructions Separate
For Claude Messages requests, place system instructions in the separate system parameter. Use user and assistant roles in messages for conversation history.
- 04
Preserve Thinking Signatures
Use the standard model name with the thinking parameter rather than a platform-side thinking alias. If you return thinking blocks in a multi-turn conversation, preserve their signature unchanged.
Giới hạn và những điều cần biết
Maximum input is 200,000 tokens; maximum output is 64,000 tokens.
Claude Messages requires max_tokens, and generation may stop before reaching that value.
Inference endpoints under /v1/* return upstream responses without a management API wrapper.
Câu hỏi thường gặp về API claude-haiku-4-5
How much does claude-haiku-4-5 cost on APISea?
Input costs $0.88 per 1M tokens, and output costs $4.40 per 1M tokens. Cached input costs $0.088 per 1M tokens; cache writes cost $1.10 per 1M tokens for a 5-minute TTL or $1.76 per 1M tokens for a 1-hour TTL. 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-haiku-4-5 through APISea?
Use the OpenAI-compatible base URL https://api.apisea.ai/v1 and send a chat completion request with model set to claude-haiku-4-5. You can also call POST /v1/messages using the native-compatible Claude Messages protocol; that endpoint accepts either x-api-key or Bearer authentication.
Which parameters does the Claude Messages interface support?
Supported controls include system, max_tokens, temperature, top_p, top_k, stream, stop_sequences, tools, tool_choice, and thinking. max_tokens is required, and the documentation recommends choosing either temperature or top_p rather than both.
What are the input and output limits?
The model supports a maximum input of 200,000 tokens and a maximum output of 64,000 tokens. Your max_tokens setting controls the requested generation budget, but the model may stop earlier.
Can I use claude-haiku-4-5 commercially?
Commercial use is subject to the provider’s terms. Review Anthropic’s applicable terms and your APISea service requirements before deploying.
Can I call the dated model name instead?
The model is also callable as claude-haiku-4-5-20251001. The date-suffixed name is suited to workflows seeking snapshot-oriented reproducibility; the supplied facts do not establish any capability difference between the two names.
Model liên quan
claude-haiku-4-5-20251001
claude-haiku-4-5-20251001-thinking
claude-haiku-5-5
claude-fable-5
claude-fable-5.1
claude-fable-5.2
claude-opus-4-5
claude-opus-4-5-20251101
Bắt đầu xây dựng với claude-haiku-4-5
Chỉ cần một key, thanh toán theo mức sử dụng từ $50; chỉ tính phí cho các request thành công.