> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trynito.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Anthropic Mapping

> Anthropic Messages concepts on the Chat Completions surface.

Anthropic-shaped code can target `/v1/messages` directly. These mappings are for routing it through `/v1/chat/completions` instead.

| Anthropic Messages | Chat Completions on Nito |
| - | - |
| Top-level `system` string | A `role: "system"` message at the start of `messages` |
| `messages` with `user` / `assistant` | Same roles |
| `max_tokens` (required) | `max_tokens` (optional, passed through) |
| `temperature`, `top_p` | Passed through |
| `stop_sequences` | `stop`, on models that advertise it |
| `model` (an Anthropic name) | A catalog ID from `GET /v1/models` |
| `stream: true` | `stream: true` (Server-Sent Events) |
| Response `content` blocks | `choices[0].message.content` (a string) |
| `stop_reason` | `finish_reason` (`stop`, `tool_calls`; a streamed failure ends with `error`) |
| `usage.input_tokens` / `output_tokens` | `usage.prompt_tokens` / `completion_tokens` |

```python theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Anthropic-style (top-level system) becomes:
messages=[
    {"role": "system", "content": "You are a concise assistant."},
    {"role": "user", "content": "Say hello."},
]
```

A leftover top-level `system` field is not read on Chat Completions.

Accepted roles: `system`, `user`, `assistant`, `tool`, `developer`. Claude models appear under `anthropic/`: `anthropic/claude-sonnet-5`, `anthropic/claude-opus-5`, `anthropic/claude-haiku-4-5`. Anthropic tool use maps to [Chat Completions tool calling](/api/features/tool-calling). Token counting on Chat Completions comes from `usage`; `/v1/messages/count_tokens` exists for a dedicated call.

## Differences

* `system_fingerprint` is always `null`.
* The error envelope is `{"error": {"message", "code", "param"}}` with no `type`.
* Exactly one choice.
* The level travels with the model: `:confidential` for attested hardware; Encrypted runs on Chat Completions only, with extra headers. See [Privacy Levels](/privacy/levels).

## Related

<CardGroup cols={3}>
  <Card title="SDKs" icon="screwdriver-wrench" href="/api/sdks">
    Overview.
  </Card>

  <Card title="Anthropic SDK Drop-in" icon="gear" href="/api/get-started/quickstart-anthropic-sdk">
    Quickstart.
  </Card>

  <Card title="Base URL Swap" icon="gear" href="/api/sdks/anthropic-drop-in/base-url-swap">
    Two paths in.
  </Card>

  <Card title="Tool Calling" icon="screwdriver-wrench" href="/api/features/tool-calling">
    Function calls.
  </Card>

  <Card title="Chat Completions" icon="message-dots" href="/api/features/chat-completions">
    The endpoint.
  </Card>

  <Card title="Privacy Levels" icon="file-shield" href="/privacy/levels">
    The four levels.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.