POST /v1/chat/completions
OpenAI-compatible chat completions. Supports streaming via SSE.
| Parameter | Type | Default | Description |
|---|---|---|---|
| model | string | required | Model ID (e.g. alims-intl/qwen-plus) |
| messages | array | required | Array of {role, content} objects |
| stream | boolean | false | Enable SSE streaming |
| temperature | number | — | 0–2; native sampling or prompt-based style, depending on the model |
| response_format | object | — | text | json_object | json_schema |
| max_tokens | integer | — | Maximum tokens to generate |
| reasoning_effort | string | — | 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.