Skip to content

Docs

API: Anthropic

Anthropic Messages dialect for clients and SDKs that speak it. Use the x-api-key header when the server is exposed beyond localhost.

Anthropic Messages dialect for clients and SDKs that speak it. Use the x-api-key header when the server is exposed beyond localhost.

All examples use the local base URL http://127.0.0.1:1337. This page is generated from the api-endpoints.v1 contract — see Server overview for auth, CORS, and exposure, and Settings reference for the controls.

Endpoints

POST /anthropic/v1/messages

Anthropic Messages completion.

Maps the Anthropic Messages request/response to a local chat model. Supports streaming.

Auth: x-api-key · Streaming: yes (SSE)

FieldTypeRequiredNotes
modelstringyesInstalled model id.
messagesarrayyesAnthropic-style message turns.
max_tokensintegeryesMaximum tokens to generate.

Response. Anthropic message object, optionally streamed as events.

Example request:

curl http://127.0.0.1:1337/anthropic/v1/messages \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "qwen35-7b-4bit",
    "max_tokens": 256,
    "messages": [{"role": "user", "content": "Hello"}]
  }'