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
| Flag | Type | Required | |
|---|---|---|---|
--max-tokens | int | yes | Upper bound on tokens to generate. Required (unlike Chat Completions). |
--messages | json | yes | The conversation so far: {role, content} objects (user, assistant only; use the top-level system field for a system prompt). |
--model | string | yes | An OpenRelay public model id, e.g. openrelay/glm-5.2. |
--stream | bool | no | Stream the response as event-typed Server-Sent Events. |
--system | string | no | The system prompt, as a top-level field. |
--max-cost | float64 | no | refuse (exit 8) when the worst-case cost exceeds this many dollars (default: ORL_MAX_COST_USD) |
--body | string | no | a JSON object of request body fields, merged under any of this command's own flags that are also set, e.g. {"key":"value"} |
--body-file | string | no | read the --body JSON object from a file (- for stdin) |
This wraps the createMessage API operation.