Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
CLICommands

orl messages create

Generate a message (Anthropic-compatible), part of the orl CLI for OpenRelay GPU VMs, pods, batches and billing.

orl messages create --max-tokens <max-tokens> --messages <messages> --model <model>

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.

Flags

FlagTypeRequired
--max-tokensintyesUpper bound on tokens to generate. Required (unlike Chat Completions).
--messagesjsonyesThe conversation so far: {role, content} objects (user, assistant only; use the top-level system field for a system prompt).
--modelstringyesAn OpenRelay public model id, e.g. openrelay/glm-5.2.
--streamboolnoStream the response as event-typed Server-Sent Events.
--systemstringnoThe system prompt, as a top-level field.
--max-costfloat64norefuse (exit 8) when the worst-case cost exceeds this many dollars (default: ORL_MAX_COST_USD)
--bodystringnoa JSON object of request body fields, merged under any of this command's own flags that are also set, e.g. {"key":"value"}
--body-filestringnoread the --body JSON object from a file (- for stdin)

This wraps the createMessage API operation.

On this page