Skip to main content
Anthropic-shaped code can target /v1/messages directly. These mappings are for routing it through /v1/chat/completions instead.
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. 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.

SDKs

Overview.

Anthropic SDK Drop-in

Quickstart.

Base URL Swap

Two paths in.

Tool Calling

Function calls.

Chat Completions

The endpoint.

Privacy Levels

The four levels.