LM0
API Reference API

Messages

Anthropic-compatible Messages API on POST /v1/messages.

The primary Anthropic SDK-compatible generation endpoint.

Endpoint

HTTP 2 lines
POST /v1/messages

Authentication

HTTP 3 lines
x-api-key: <api-key>
anthropic-version: 2023-06-01

OpenAI-style Authorization: Bearer is also accepted by the gateway.

Example

Bash 12 lines
curl https://api.17.wtf/v1/messages \
  -H "x-api-key: $LM0_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-pool/your-model",
    "max_tokens": 512,
    "messages": [
      { "role": "user", "content": "Explain rate limits simply." }
    ]
  }'

Streaming

Anthropic SSE streaming is supported when "stream": true. Events are translated from the gateway’s canonical stream into the Anthropic event shapes clients expect.

Count tokens

HTTP 2 lines
POST /v1/messages/count_tokens

Behavior depends on the resolved upstream:

  • Anthropic targets may proxy natively where supported
  • OpenAI targets use a local estimate

This route is not blocked by maintenance pause.

Cross-provider translation

You can call /v1/messages even when the selected model routes to an OpenAI-compatible upstream. LM0 translates tools, text, and (where possible) reasoning between formats.

LM0 · Documentation for every model you ship

api.17.wtf