DocsAPI reference

OpenAPI specification

Model IDs and options in examples are illustrative. Select an available model from GET /v1/models and check its capabilities and current prices.

POST /v1/chat/completions

OpenAI-compatible chat completions. Supports streaming via SSE.

ParameterTypeDefaultDescription
modelstringrequiredModel ID (e.g. alims-intl/qwen-plus)
messagesarrayrequiredArray of {role, content} objects
streambooleanfalseEnable SSE streaming
temperaturenumber—0–2; native sampling or prompt-based style, depending on the model
response_formatobject—text | json_object | json_schema
max_tokensinteger—Maximum tokens to generate
reasoning_effortstring—none | low | medium | high | xhigh

Example

curl -X POST https://relayon.app/v1/chat/completions \
  -H "Authorization: Bearer ro_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "alims-intl/qwen-plus",
    "messages": [
      {"role": "system", "content": "You are helpful."},
      {"role": "user", "content": "Hello!"}
    ],
    "stream": true
  }'

JSON output and automatic repair

Set { "type": "json_object" } in response_format for an object, or use json_schema with a named schema. When the response-healing plugin is enabled, non-streaming JSON requests pass through syntax repair. Valid JSON stays unchanged; RelayOn attempts to remove markdown fences and fix formatting errors. If repair fails, the original content is returned with its usage and finish reason. Repair does not retry inference or guarantee schema compliance.

Inspect X-RelayOn-JSON-Repair: unchanged, repaired, failed or skipped. X-RelayOn-JSON-Repair-Reason explains failures and skips. Streaming, refusals, tool calls and responses marked as truncated are not repaired. Repair metadata is preserved on cache hits and readable from browser clients.

Model-dependent generation controls

Some models use prompt instructions for JSON format and schema requests. Strict schema compliance is not guaranteed. Explicit temperature values from 0 to 2 select a restrained, balanced or exploratory response style; this approximates style rather than sampling temperature. Zero does not guarantee deterministic output. These responses include X-RelayOn-Temperature-Mode: prompt. Omitting temperature leaves the model’s default style.

See the feature guides for JSON mode examples, repair statuses and limits, and temperature ranges.