API Endpoints
15 min
Use model lunax-chat, messages with system/user/assistant roles and string content, optional max_tokens (1–8192, default 1024), temperature (0–2), and stream (default false). The alias uses the operator-configured active model; arbitrary upstream model IDs are refused. Streaming returns SSE chat.completion.chunk events and [DONE]. Set stream_options.include_usage=true to receive the usage chunk.
curl https://lunax.co/api/v1/chat/completions -H "Authorization: Bearer $LUNAX_API_KEY" -H "Content-Type: application/json" -d '{"model":"lunax-chat","messages":[{"role":"user","content":"Hello"}]}'