Chat completions
POST /v1/chat/completions — a fully OpenAI-compatible endpoint with streaming, tools, and JSON mode.
POST ${PUBLIC_API_URL}/v1/chat/completions is the core endpoint. It supports tool calls, JSON mode, and both streaming and non-streaming responses — the same surface as OpenAI's chat completions API.
POST https://api.relixr.com/v1/chat/completions
Authorization: Bearer $RELIXR_API_KEY
{
"model": "claude-sonnet-4-5",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Summarize edge routing in one sentence."}
],
"temperature": 0.7,
"max_tokens": 512
}Streaming Reliability
- SSE streams emit
: keepalivecomments every 15 seconds during upstream silence, so long-lived connections don't get killed by idle timeouts. - If your client disconnects, the gateway aborts the upstream provider request and finalizes billing for the tokens received so far — you're never charged for tokens you never got.
- Connection resume via
Last-Event-IDisn't supported in v1. Open a new request with a freshrequest_idinstead.
Tip
If you stream to a browser or a flaky mobile connection, keep your own reconnect logic simple: on disconnect, just retry the whole request. The keepalive comments mean a hung connection is rare, not something you need to work around.
Error responses follow the gateway's shared error contract — see Errors for the full list of status codes.
Was this helpful?
Still stuck? Help center · Doctor