# Messages (Anthropic)

> POST /v1/messages — the Anthropic Messages format for Claude Code and the Anthropic SDK.

`POST /v1/messages` is the Anthropic Messages format, used by Claude Code and
the Anthropic SDK. Their base URL has no `/v1`: the SDK appends the path itself.
https://ai-seller.vibe-codes.ru

> The gateway does not translate formats: the request reaches the model's
> provider in the Anthropic format. The endpoint works only with models whose
> provider supports that format. If a model returns an error, use it through
> [Chat Completions](https://ai-seller.vibe-codes.ru/en/docs/chat-completions) or [Responses](https://ai-seller.vibe-codes.ru/en/docs/responses).

## Request

```bash [curl]
curl https://ai-seller.vibe-codes.ru/v1/messages \
  -H "x-api-key: $AISELLER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.6-sol",
    "max_tokens": 200,
    "system": "Answer briefly.",
    "messages": [{"role": "user", "content": "How many planets are in the Solar System?"}]
  }'
```

```python [Python]
import anthropic

client = anthropic.Anthropic(base_url="https://ai-seller.vibe-codes.ru", api_key="$AISELLER_API_KEY")
msg = client.messages.create(
    model="gpt-5.6-sol",
    max_tokens=200,
    system="Answer briefly.",
    messages=[{"role": "user", "content": "How many planets are in the Solar System?"}],
)
print(msg.content[0].text)
```

## Response

```json
{
  "id": "msg_...",
  "type": "message",
  "role": "assistant",
  "model": "gpt-5.6-sol",
  "content": [{"type": "text", "text": "Eight."}],
  "stop_reason": "end_turn",
  "usage": {"input_tokens": 20, "output_tokens": 2}
}
```

## Specifics

- **Authentication** — `x-api-key` or `Authorization: Bearer`, both work. The
  gateway sets the `anthropic-version` header itself; `anthropic-beta` is not
  passed to the provider, so API beta features are unavailable.
- **Errors** come in the Anthropic envelope (`{"type": "error", ...}`) — the SDK
  and Claude Code parse them natively. See [Errors](https://ai-seller.vibe-codes.ru/en/docs/errors).
- **Parameters:** `stop_sequences` instead of `stop`, response format via
  `output_config.format`; `seed`, `response_format` and `reasoning_effort` are
  silently stripped here. `metadata` is replaced with the gateway's identifier.
- **Tools:** your own (no `type`, or `custom`) and Anthropic client tools —
  `bash_*`, `text_editor_*`, `memory_*`, `computer_*`. Server tools (web
  search, code execution, MCP) are stripped.
- **Not available:** `/v1/messages/count_tokens`, the Files API and
  `compaction` (400).
- **Streaming** — `"stream": true`, `message_*` and `content_block_*` events;
  usage is in `message_start` and `message_delta`. See [Streaming](https://ai-seller.vibe-codes.ru/en/docs/streaming).

The full parameter list is in [Request parameters](https://ai-seller.vibe-codes.ru/en/docs/params).
