Messages

An Anthropic-shaped request and response for teams already integrated against the Messages API. The request body, response shape, and streaming events follow the Anthropic format — only the base URL and authentication header differ.

Base URL behavior

POST/api/v1/messages

Raw HTTP clients and cURL post directly to https://llmrpm.com/api/v1/messages. The Anthropic SDKs append /v1/messages to whatever baseURL / base_url you configure, so when using an SDK, point it at https://llmrpm.com/api — one path segment shorter than the raw endpoint — not at https://llmrpm.com/api/v1.

A common mistake
Configuring the SDK with https://llmrpm.com/api/v1 produces requests to /api/v1/v1/messages, which does not exist. Use https://llmrpm.com/api for SDK clients.

Headers

HeaderBehavior
Authorization: Bearer …Required on every request. LLMRPM authenticates from this header, not from x-api-key — see Authentication for why the default Anthropic SDK behavior needs an override.
anthropic-versionOptional. LLMRPM does not forward this header upstream — it validates and routes your request from the body alone, so you can include it for SDK compatibility without it changing behavior.
Content-Typeapplication/json on every request.

cURL

cURL
curl https://llmrpm.com/api/v1/messages \
  -H "Authorization: Bearer $LLMRPM_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "messages": [{ "role": "user", "content": "Hello" }]
  }'

Node — @anthropic-ai/sdk

The Node SDK accepts an authToken constructor option that sends your key as a bearer token instead of the default x-api-key scheme — this is the override referenced in Authentication:

Node — @anthropic-ai/sdk
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://llmrpm.com/api",
  authToken: process.env.LLMRPM_API_KEY, // sent as Authorization: Bearer
});

const message = await client.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Hello" }],
});

console.log(message.content);

Python — anthropic

The Python SDK has the equivalent auth_token constructor argument:

Python — anthropic
import os
from anthropic import Anthropic

client = Anthropic(
    base_url="https://llmrpm.com/api",
    auth_token=os.environ["LLMRPM_API_KEY"],  # sent as Authorization: Bearer
)

message = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)

print(message.content)