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. 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.
  • End-to-end encryption runs on Chat Completions only, with extra headers. See Enabling End-to-End Encryption.

SDKs

Overview.

Anthropic SDK Drop-in

Quickstart.

Base URL Swap

Two paths in.

Tool Calling

Function calls.

Chat Completions

The endpoint.

How Privacy Works

Privacy-preserving hardware on every call.