# Anthropic Messages

Anthropic Messages API surface.

`POST /v1/messages`

## Overview

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.

## Parameters

- `model` (string) — required: Claude model ID.
- `messages` (array) — required: Messages in Anthropic format.
- `max_tokens` (integer) — required: Upper bound on generated tokens.
- `system` (string | content blocks): System prompt in Anthropic format.

## Example

```bash
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"}]
  }'
```

## Response

```json
{
  "id": "msg_7c41ab",
  "type": "message",
  "role": "assistant",
  "content": [{ "type": "text", "text": "..." }],
  "stop_reason": "end_turn",
  "usage": { "input_tokens": 18, "output_tokens": 240 }
}
```
