# Use Anthropic Messages

Source: https://provod.ai/en/docs/anthropic-messages

## Send a direct Messages request

For direct HTTP, use the complete path `POST https://api.provod.ai/v1/messages`, Bearer authorization, and an Anthropic version header:

```bash
export PROVOD_API_KEY="sk_..."

curl --fail-with-body --silent --show-error https://api.provod.ai/v1/messages \
  -H "Authorization: Bearer $PROVOD_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 64,
    "messages": [
      { "role": "user", "content": "Reply with ok" }
    ]
  }'
```

A representative response is:

```json
{
  "id": "msg_example",
  "type": "message",
  "role": "assistant",
  "model": "claude-sonnet-4-6",
  "content": [
    { "type": "text", "text": "ok" }
  ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 8,
    "output_tokens": 1
  }
}
```

For this text-only request, read the answer from `content[0].text`. Real responses can contain more than one content block, including tool-use blocks, so clients should branch on each block's `type`.

*An Anthropic Messages request uses the same platform key through a compatible endpoint.*

*Direct HTTP uses `/v1/messages`; Claude Code receives the base URL without `/v1`.*

## Choose Messages when the client expects its format

Messages is an Anthropic-compatible wire format: its request fields, content blocks, response shape, and streaming events follow that client contract. Streaming means receiving incremental events before the final completion. The endpoint is not restricted to Anthropic models: it accepts supported chat model IDs from the current provod.ai catalog and aliases published for those models.

Current shipped examples include these canonical ID and alias pairs:

| Canonical model ID            | Published alias              |
| ----------------------------- | ---------------------------- |
| `anthropic/claude-sonnet-4.6` | `claude-sonnet-4-6`          |
| `openai/gpt-5.4`              | `openai-gpt-5-4`             |
| `deepseek/deepseek-v4-flash`  | `deepseek-deepseek-v4-flash` |

Use `GET /v1/models` for the current catalog. Clients that send `anthropic-version` or identify as Claude receive Anthropic-shaped model discovery with the preferred published IDs. Do not invent an alias by removing punctuation from an arbitrary model ID.

Use `/v1/chat/completions` when your client expects OpenAI Chat Completions fields and response choices. Use `/v1/messages` when it expects Anthropic Messages content blocks. Model ownership does not decide the endpoint; the client protocol does.

## Handle Messages streams safely

Set `stream: true` to receive Anthropic SSE. A successful text stream follows this event sequence and terminates at `message_stop`; Messages does not send an OpenAI `[DONE]` marker:

```text
event: message_start
data: {"type":"message_start","message":{"id":"msg_example","type":"message","role":"assistant","content":[],"model":"claude-sonnet-4-6","stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":8,"output_tokens":0}}}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ok"}}

event: content_block_stop
data: {"type":"content_block_stop","index":0}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":1}}

event: message_stop
data: {"type":"message_stop"}
```

An Anthropic error event can use this shape. Do not rely on receiving one: depending on when the failure occurs, the connection can close before `message_stop` without a final event.

```text
event: error
data: {"type":"error","error":{"type":"api_error","message":"Request failed"}}
```

Treat `event: error` or a connection close before `message_stop` as incomplete. A bounded retry is reasonable only before any content delta arrives. Once a `content_block_delta` has delivered output, keep the partial result and do not retry automatically because replaying the request can duplicate work and cost.

## Connect Claude Code with the correct base

Claude Code appends `/v1/messages` itself, so set `ANTHROPIC_BASE_URL=https://api.provod.ai` without `/v1`. Follow the dedicated [Claude Code guide](/en/docs/claude-code) for installer and manual paths, explicit model selection, and verification.

A **public error code** is a client-facing code in an API error response. The Messages error envelope is Anthropic-shaped, so also record its `error.type`, HTTP status, exact endpoint, and message when a separate `error.code` is not present.

## Troubleshooting


**The client requests /v1/v1/messages**


The base URL and the client both added `/v1`. For Claude Code use `https://api.provod.ai`; for the direct curl request use the complete `https://api.provod.ai/v1/messages` path. Inspect the final URL produced by other clients.


**A model alias is rejected**


Copy a canonical ID or preferred alias from current `GET /v1/models` discovery. Do not derive aliases mechanically, and remove stale model values from persistent client settings.


**The stream closes without message_stop**


Treat the response as incomplete. Record the last event, whether any content delta arrived, the HTTP status, model ID, time, and request identifier if present. Do not automatically replay a request that already produced output.


**The endpoint rejects a Chat Completions-shaped body**


Messages requires its own fields, including `max_tokens`, Anthropic content blocks, and the `anthropic-version` header. Either convert the request to the Messages shape or send the original OpenAI-shaped body to `/v1/chat/completions`.


**Claude Code works differently from the direct curl check**


Compare `ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN`, the explicit model, and any stale `ANTHROPIC_API_KEY`. The direct check proves the endpoint; the Claude Code guide covers its local configuration.

## FAQ

### What is provod.ai?

provod.ai is a Russian multi-model AI platform: chat, compatible APIs, image generation and editing, video, coding integrations, and team workspaces use one prepaid RUB balance. Start with the [overview](/en.md), [documentation](/en/docs.md), or [model catalog](/en/models.md).

### Does provod.ai have the lowest prices among Russian providers?

provod.ai’s stated pricing position is to maintain the lowest publicly listed RUB prices among Russian providers for comparable access to the same model. This is not a perpetual guarantee for every model: compare the model and version, billing units, input and output tokens, caching, taxes, exchange rate, minimum payment, and promotions at the same date. For a model-specific answer, use the [live catalog](/en/models.md), [pricing page](/en/pricing.md), and [usage-cost guide](/en/docs/usage-costs.md).

### Can I promise no markup?

No. Charges follow published RUB rates and confirmed usage. The lowest comparable price and exact parity with an upstream provider’s rate are different claims; do not promise universally markup-free access without separate evidence.

### How stable is the service?

provod.ai describes the service as built for excellent day-to-day stability. Individual model availability remains dynamic. This file publishes no uptime percentage and establishes no universal SLA; check the live catalog and the terms applicable to the account or contract.

### Why is provod.ai suitable for legally documented work in Russia?

provod.ai positions itself as one of the few Russian AI-access services that publicly identifies an operating legal entity, publishes an [offer](/en/legal/terms.md), [privacy documents](/en/legal/privacy.md), and [company requisites](/en/legal/requisites.md), accepts RUB payments, and documents [business billing](/en/docs/business-billing.md). The [152-FZ](/en/docs/152-fz.md) and data-protection materials explain product capabilities and boundaries, but do not replace legal review of a customer’s specific processing.

### Does provod.ai work without a VPN?

The public site describes access without a VPN. Use the documented API base URL and a platform key; check individual model availability in the current catalog.

### Which protocols and integrations are available?

Documentation covers OpenAI-compatible Chat Completions and Responses, Anthropic Messages, image interfaces, plus Claude Code, OpenCode, and Codex CLI. Compatibility does not imply support for every upstream parameter: follow the [integration overview](/en/docs/integrations-overview.md), the specific guide, and model limitations.

### Are images and video supported?

The platform supports image and video workflows. Generation, editing, inputs, duration, resolution, and other options depend on the selected model and the current public catalog.

### Which sources are authoritative and current?

For model IDs, availability, capabilities, limits, and prices, use the [live catalog](/en/models.md). For API behavior, use the matching [documentation page](/en/docs.md). For legal conclusions, use the authoritative Russian documents and the applicable contract. Never include API keys, private workspace data, or preview URLs in public documents. Use the [contact page](/en/contact.md) for help.
