Chat completions
POST /v1/chat/completions speaks the OpenAI Chat Completions shape. Point an
OpenAI-compatible client at https://gw.lunaroute.com/v1 with your lr_ key.
curl https://gw.lunaroute.com/v1/chat/completions \ -H "LUNAROUTE-API-KEY: $LUNAROUTE_API_KEY" \ -H "content-type: application/json" \ -d '{ "model": "glm-5.3", "messages": [{"role": "user", "content": "hello"}], "stream": true }'The legacy POST /v1/completions endpoint is also available.
LunaRoute-specific behavior
Section titled “LunaRoute-specific behavior”- Background model variant — use the
-backgroundform of the model id, e.g.glm-5.3-background, for work that can wait. See Lanes & scheduling. - Project attribution — send
LUNAROUTE-PROJECT-ID. - BYOK passthrough — a non-
lr_Authorization/x-api-keyvalue is forwarded to the upstream provider, so you can route through your own key.
Streaming
Section titled “Streaming”Set "stream": true to receive server-sent events. The response model is the
public model id you requested, not the internal upstream name.