ccapi
🇺🇸English
  • 🇨🇳简体中文
  • 🇺🇸English
Home
Home
🇺🇸English
  • 🇨🇳简体中文
  • 🇺🇸English
🇺🇸English
  • 🇨🇳简体中文
  • 🇺🇸English
  1. Anthropic
  • OpenClaw + CCAPI LLM Integration Guide
  • claude code integration
  • codex cli integration
  • gemini cli integration
  • Chat
    • OpenAI
      • Create Chat Completion
      • Create Response
    • Google
      • Generate Content
      • Stream Generate Content
    • Anthropic
      • Create Message
        POST
    • DeepSeek
      • Create Chat Completion
    • MiniMax
      • Create Chat Completion
  • Image
    • nano banana
      • Generate Image
    • z-image-turbo
      • integration docs
    • seedream
      • integration doc
  • Video
    • seedance
    • vidu
  • Audio
    • Producer
      • Generate Music
      • Generate Lyrics
      • Extend Music
      • Create Cover
      • Create Variation
      • Replace Segment
      • Vocals Swap
      • Instrumentals Swap
      • Stem Separation
      • Download Audio
      • Upload Audio
      • Generate Video
      • Fetch Task Status
      • Batch Fetch Tasks
    • Suno
      • Generate Music
      • Fetch Task Status
      • Generate Lyrics
      • Extend Music
      • Create Cover
      • Extract Stems
      • Extract All Stems
      • Add Vocals
      • Add Instrumental
      • Replace Section
      • Remaster Song
      • Mashup
      • Sample Section
      • Generate Sounds
      • Generate MIDI
      • Upload Audio
      • Concatenate Music
      • Get Aligned Lyrics
      • Generate Music Video
      • Export as WAV
      • Create Voice Persona(unavailable)
      • Detect BPM
      • Extract Vocals
      • Upsample Tags
      • Batch Fetch Tasks
  1. Anthropic

Create Message

POST
https://api.ccapi.ai//v1/messages
Request Anthropic series models using the Claude native message format.
If anthropic-version is not provided, the project defaults to 2023-06-01.
When stream=true, the endpoint returns text/event-stream.

请求参数

Header 参数

Body 参数application/json必填

示例
{
    "model": "claude-opus-4-6",
    "max_tokens": 1024,
    "system": "You are a rigorous technical assistant.",
    "messages": [
        {
            "role": "user",
            "content": "Explain why idempotent design is important for payment callbacks."
        }
    ]
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://api.ccapi.ai//v1/messages' \
--header 'x-api-key: sk-xxxx' \
--header 'anthropic-version: 2023-06-01' \
--header 'anthropic-beta;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "claude-opus-4-6",
    "max_tokens": 1024,
    "system": "You are a rigorous technical assistant.",
    "messages": [
        {
            "role": "user",
            "content": "Explain why idempotent design is important for payment callbacks."
        }
    ]
}'

返回响应

🟢200成功
application/json
Success
Body

示例
{
    "id": "msg_01ABC",
    "type": "message",
    "role": "assistant",
    "model": "claude-opus-4-6",
    "content": [
        {
            "type": "text",
            "text": "Idempotency prevents duplicate charges, duplicate shipments, or duplicate accounting when payment platforms send repeated notifications."
        }
    ],
    "stop_reason": "end_turn",
    "usage": {
        "input_tokens": 58,
        "output_tokens": 36
    }
}
🟠401未认证
修改于 2026-03-16 06:03:11
上一页
Stream Generate Content
下一页
Create Chat Completion
Built with