Generate a message (Anthropic-compatible)
Generates a model response in the Anthropic Messages shape, a drop-in for the Anthropic SDKs and Claude Code on models that support messages. Messages is a second online family alongside Chat Completions; check a model's supported_apis on GET /v1/models before calling it rather than assuming. Requires a funded balance. Send the API key as x-api-key (the Anthropic SDK convention) or as Authorization Bearer; either is accepted. Set "stream" to true for event-typed Server-Sent Events (message_start, content_block_delta, message_stop, and so on). The request body is capped at 10 MiB.
Required permission
Requires the inference.invoke permission. See Permissions for the roles and API key permissions that include it.
Command line
The orl CLI wraps this endpoint:
orl messages create --max-tokens <max-tokens> --messages <messages> --model <model>apiKeyAuthorizationBearer <token>OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).
application/json- body
An Anthropic-compatible Messages request. Opaque: unlisted Anthropic parameters (temperature, top_p, stop_sequences, tools, tool_choice, ...) are forwarded as sent.
model*stringAn OpenRelay public model id, e.g. openrelay/glm-5.2.
max_tokens*integerUpper bound on tokens to generate. Required (unlike Chat Completions).
messages*array<>The conversation so far: {role, content} objects (user, assistant only; use the top-level system field for a system prompt).
system?stringThe system prompt, as a top-level field.
stream?booleanStream the response as event-typed Server-Sent Events.
[key: string]?anyOK
- response
An Anthropic message object (opaque; additionalProperties carries the rest of the dialect).
id?stringtype?"message""message"role?"assistant""assistant"model?stringAlways the public OpenRelay model id requested.
content?array<>stop_reason?stringusage?openrelay?What the request is billed, on every online inference response.
[key: string]?anycurl -X POST 'https://inference.openrelay.inc/v1/messages' \ -H 'Content-Type: application/json' \ -d '{ "model": "string", "max_tokens": 0, "messages": [ {} ]}'{ "id": "string", "type": "message", "role": "assistant", "model": "string", "content": [ {} ], "stop_reason": "string", "usage": {}, "openrelay": { "cost_nano_usd": 0, "priced_at": "string" }}Overview
Generate a model response in the Anthropic Messages shape for models that support it: a drop-in for the Anthropic SDKs and Claude Code. Served by the inference endpoint (inference.openrelay.inc).
Overview
Turn text into vectors for search, retrieval, clustering and deduplication, OpenAI-compatible, from the multilingual openrelay/bge-m3. Served by the inference endpoint (inference.openrelay.inc).