1. Chat
AboAI-Doc
English
  • 中文
  • English
  • Home Page
  • AboAi-API
    • Model
      • Native OpenAI Format
      • Native Gemini Format
    • Chat
      • Native OpenAI Format
        POST
      • Native Gemini Format
        POST
      • Native Claude Format
        POST
      • Responses Request (openai)
        POST
    • Audio
      • Native OpenAI Format TTS
      • Native Gemini Format TTS
    • Images
      • Native OpenAI Format Image Generation
      • Native Gemini Format Image Generation
      • Native OpenAI Format Image Editing (JSON)
      • Native OpenAI Format Image Editing (Multipart)
    • Video
      • Seedance2.0 format
        • Create Video Generation Task
        • Query Video Generation Task Status
    • Vector
      • Embeddings
        • Create Embedding
    • Translation
      • Speech Translation
  • AI application
    • AboAI API Integration with Claude Code
    • AboAI API Integration with Cursor
    • AboAI API Integration with Codex-cli
    • AboAI API Integration with Codex Desktop
    • AboAI API Integration with Hermes Agent
  1. Chat

Native Claude Format

POST
/v1/messages

Introduction#

Claude's native message interface, suitable for native Anthropic clients such as Claude Code. This interface complies with Anthropic's API specifications and provides full feature support for Claude models, including advanced capabilities like Extended Thinking and tool calling.
You can test different scenarios by switching the Body example below or by setting the stream field to true.
All requests share the following headers:
x-api-key: sk-xxx (or use Authorization)
anthropic-version: 2023-06-01
content-type: application/json
When stream=true, the response will be an SSE stream (content-type: text/event-stream), and the event types follow the native Anthropic specification (message_start / content_block_start / content_block_delta / content_block_stop / message_delta / message_stop).

Prompt Caching#

Prompt Caching allows you to cache frequently used context, significantly reducing costs and improving response times. There are two ways to enable it, which can be used individually or in combination:
ApproachUsageRecommended Use Case
Auto-CachingPlace cache_control at the top level of the request bodyMulti-turn conversations. The breakpoint automatically lands on the last cacheable block and moves forward with the conversation, eliminating the need to manually maintain tags.
Explicit BreakpointsAdd cache_control markers directly to content blocks in system or messagesPrecise cache control. Ideal when you need to cache specific content boundaries, such as only caching the system prompt or a specific long document.

Request

Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Bodyapplication/json

🟠400
🟠401
🟠403
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location 'https://api.aboai.ai/v1/messages' \
--header 'Content-Type: application/json' \
--data '{
    "model": "claude-sonnet-4.5",
    "max_tokens": 1024,
    "messages": [
        {
            "role": "user",
            "content": "Hello, nice to meet you"
        }
    ]
}'
Response Response Example
200 - 成功示例
{
    "model": "claude-sonnet-4-5-20250929",
    "id": "msg_bdrk_01DJBYweRg351XHSgq6JcTsE",
    "type": "message",
    "role": "assistant",
    "content": [
        {
            "type": "text",
            "text": "Hello! Nice to meet you too! How are you doing today? Is there anything I can help you with?"
        }
    ],
    "stop_reason": "end_turn",
    "usage": {
        "input_tokens": 13,
        "cache_creation_input_tokens": 0,
        "cache_read_input_tokens": 0,
        "cache_creation": {
            "ephemeral_5m_input_tokens": 0,
            "ephemeral_1h_input_tokens": 0
        },
        "output_tokens": 26
    }
}
Modified at 2026-08-19 03:01:02
Previous
Native Gemini Format
Next
Responses Request (openai)
Built with