Messages (Claude)
LootVM accepts Anthropic-compatible Messages requests at:
POST https://api.lootvm.com/v1/messagesAuthenticate with a LootVM-issued API key. You may use either:
Authorization: Bearer <lootvm-api-key>or, on this path:
x-api-key: <lootvm-api-key>anthropic-version: 2023-06-01Send anthropic-version (for example 2023-06-01) when your client expects Anthropic’s HTTP API.
This is not the same wire format as Chat Completions. Use Messages when your SDK or tool speaks Anthropic; use Chat Completions for OpenAI-compatible clients.
Minimal request
Section titled “Minimal request”max_tokens is required on Messages requests.
curl --fail-with-body https://api.lootvm.com/v1/messages \ -H "Authorization: Bearer ${LOOTVM_KEY}" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "your-enabled-model", "max_tokens": 256, "messages": [ {"role": "user", "content": "Say hello in one sentence."} ] }'Choose model from GET /v1/models for your key. Models that are not enabled for your workspace return an error.
A successful non-stream response follows the Anthropic Messages object shape (ids and usage vary by model):
{ "id": "msg_…", "type": "message", "role": "assistant", "model": "your-enabled-model", "content": [ { "type": "text", "text": "Hello! How can I help you today?" } ], "stop_reason": "end_turn"}Common fields
Section titled “Common fields”| Field | Notes |
|---|---|
model |
Required. Must be enabled for your key. |
messages |
Required. Anthropic-style turns (user / assistant). |
max_tokens |
Required. Maximum tokens to generate. |
system |
Optional. System prompt string when your client uses the top-level field. |
stream |
Optional. When true, the response is streamed as server-sent events when supported. |
Exact accepted fields depend on the model and channel behind the gateway. Start with model, max_tokens, and messages.
Streaming
Section titled “Streaming”curl --fail-with-body -N https://api.lootvm.com/v1/messages \ -H "Authorization: Bearer ${LOOTVM_KEY}" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "your-enabled-model", "max_tokens": 256, "stream": true, "messages": [ {"role": "user", "content": "Stream a short greeting."} ] }'Event shapes follow the Anthropic Messages streaming protocol when the selected model and path support streaming.
Contrast with Chat Completions
Section titled “Contrast with Chat Completions”| Chat Completions | Messages (Claude) | |
|---|---|---|
| Path | POST /v1/chat/completions |
POST /v1/messages |
| Typical auth | Authorization: Bearer |
Bearer or x-api-key (+ anthropic-version) |
| Required body | model, messages |
model, max_tokens, messages |
| Client ecosystem | OpenAI SDKs / OpenAI-compatible tools | Anthropic SDKs / Claude-oriented tools |
Do not send OpenAI Chat Completions JSON to /v1/messages, or Anthropic Messages JSON to /v1/chat/completions.
Next steps
Section titled “Next steps”- Authentication — key headers
- Chat Completions — OpenAI-compatible path
- Models and Pricing — enabled models and prices
- Claude CLI — point Claude Code at LootVM