API overview
Every endpoint the gateway exposes, which format it speaks, and what it returns.
Three endpoints. Two request formats. One key.
| Method | Path | Format | Purpose |
|---|---|---|---|
| POST | /v1/messages | Anthropic Messages | Chat completion, Anthropic envelope |
| POST | /v1/chat/completions | OpenAI Chat Completions | Chat completion, OpenAI envelope |
| GET | /v1/models | OpenAI-style list | Model ids your key can call |
A machine-readable description is published at /openapi.json, and a plain-text summary of the whole site at /llms.txt and /llms-full.txt.
Choosing an endpoint
They front the same models at the same price. Pick by what your client already emits — do not translate formats yourself.
| Endpoint | Auth header | Response shape | Streaming |
|---|---|---|---|
/v1/messages | x-api-key or Bearer | content[] array + usage | SSE, content_block_delta events |
/v1/chat/completions | Bearer | choices[].message.content | SSE, choices[].delta.content chunks |
The streaming shapes differ and are not interchangeable. A client written for
choices[].delta.content will read nothing at all from a Messages stream. See Streaming.Common headers
| Header | Applies to | Notes |
|---|---|---|
content-type: application/json | both POSTs | Required |
x-api-key | Messages | Anthropic style |
Authorization: Bearer | both | OpenAI style; also accepted by Messages |
anthropic-version: 2023-06-01 | Messages | Set automatically by Anthropic SDKs |
accept: text/event-stream | both | Set by SDKs when stream is true |