Anthropic Messages

Anthropic Messages API surface.

01Overview

Accepts Anthropic Messages requests and translates them through CAPI's shared chat relay. Existing clients can use the Anthropic request shape; tool use, image input, streaming, and other model-specific features depend on the configured upstream. Anthropic-only features are not guaranteed to map to every OpenAI-compatible channel.

POST/v1/messages
Base URL https://capi.minapp.xinAPI version v1Authentication Bearer YOUR_API_TOKEN

02Parameters

NameTypeDescription
model*stringClaude model ID.
messages*arrayMessages in Anthropic format.
max_tokens*integerUpper bound on generated tokens.
systemstring | content blocksSystem prompt in Anthropic format.

03Request body

JSON
{
  "model": "claude-opus-5",
  "max_tokens": 1024,
  "messages": [
    { "role": "user", "content": "Explain the CAP theorem." }
  ]
}

Example

Anthropic Messages

cURL
curl -X POST https://capi.minapp.xin/api/v1/messages \
  -H "x-api-key: YOUR_API_TOKEN" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello"}]
  }'
HTTP 200· OK
{
  "id": "msg_7c41ab",
  "type": "message",
  "role": "assistant",
  "content": [{ "type": "text", "text": "..." }],
  "stop_reason": "end_turn",
  "usage": { "input_tokens": 18, "output_tokens": 240 }
}