{"openapi":"3.1.0","info":{"title":"LUX AI API","version":"1.2.0","description":"Authenticated AI gateway with compact generation and OpenAI-compatible Chat Completions, validated native tools, reasoning, vision, transactional agent streaming, and upstream failover."},"servers":[{"url":"https://api.lux-ai.cz"}],"paths":{"/health":{"get":{"summary":"Service liveness","responses":{"200":{"description":"Process is alive"}}}},"/ready":{"get":{"summary":"Load-balancer readiness","responses":{"200":{"description":"Ready to accept generation requests"},"503":{"description":"Not ready"}}}},"/v1/models":{"get":{"summary":"Available aliases and reasoning levels","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Model aliases"}}}},"/v1/generate":{"post":{"summary":"Generate a compact or streamed response","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRequest"}}}},"responses":{"200":{"description":"Compact JSON, or compact SSE when x=true","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateResponse"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request"},"401":{"description":"Invalid API key"},"429":{"description":"Rate limit exceeded"},"503":{"description":"Service busy or unavailable"}}}},"/v1/chat/completions":{"post":{"summary":"OpenAI-compatible chat completion with native function calling","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"OpenAI-compatible JSON or SSE response; streamed tool calls are emitted in choices[].delta.tool_calls"},"400":{"description":"Invalid request"},"401":{"description":"Invalid API key"},"429":{"description":"Rate limit exceeded"},"503":{"description":"Service busy or unavailable"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"lux-…"}},"schemas":{"FunctionTool":{"type":"object","required":["type","function"],"additionalProperties":false,"properties":{"type":{"type":"string","const":"function"},"function":{"type":"object","required":["name","parameters"],"properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"description":{"type":"string","maxLength":16000},"parameters":{"type":"object","description":"JSON Schema for function arguments"},"strict":{"type":"boolean"}}}}},"GenerateRequest":{"type":"object","properties":{"m":{"type":"string","enum":["lite","flash","pro","ultra"],"default":"flash"},"p":{"type":"string","description":"User prompt"},"a":{"type":"array","maxItems":8,"description":"Flash/Ultra media tuples: [i|v, HTTPS URL or supported base64 data URL]. i=image, v=video.","items":{"type":"array","minItems":2,"maxItems":2,"prefixItems":[{"type":"string","enum":["i","v"]},{"type":"string"}]}},"s":{"type":"string","description":"Optional system prompt"},"c":{"type":"array","description":"History tuples: [role, text], where role is u/a/s","items":{"type":"array","prefixItems":[{"type":"string","enum":["u","a","s"]},{"type":"string"}],"minItems":2,"maxItems":2}},"messages":{"type":"array","maxItems":200,"description":"Standard messages, including assistant.tool_calls and role=tool; alternative to p/c/s/a"},"tools":{"type":"array","maxItems":64,"items":{"$ref":"#/components/schemas/FunctionTool"}},"tool_choice":{"description":"none, auto, required, or a named function choice"},"parallel_tool_calls":{"type":"boolean","description":"Compatibility hint. Flash accepts this field, but its OpenRouter providers do not advertise it; the gateway omits only this field upstream while preserving native tools/tool_calls."},"stream_reliability":{"type":"string","enum":["live","transactional"],"description":"live (default) streams text and tool_calls as they are generated; transactional buffers and validates the complete upstream result before emitting model data"},"n":{"type":"integer","minimum":1,"maximum":943718,"description":"Maximum output tokens; the exact per-model limit is returned by GET /v1/models."},"t":{"type":"number","minimum":0,"maximum":2},"r":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["none","low","high","xhigh","max"]}],"description":"Reasoning effort; available levels depend on m"},"i":{"type":"boolean","default":false,"description":"Include reasoning in response"},"x":{"type":"boolean","default":false,"description":"Use compact SSE streaming"}}},"GenerateResponse":{"type":"object","required":["v"],"properties":{"v":{"type":"integer","const":1},"r":{"type":"string","description":"Final answer"},"q":{"type":"string","description":"Reasoning, only when i=true"},"tool_calls":{"type":"array","description":"Native OpenAI-compatible tool calls"},"finish_reason":{"type":["string","null"]}}},"ChatCompletionRequest":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","enum":["lite","flash","pro","ultra"]},"messages":{"type":"array","minItems":1,"maxItems":200},"tools":{"type":"array","maxItems":64,"items":{"$ref":"#/components/schemas/FunctionTool"}},"tool_choice":{"description":"none, auto, required, or {type:function,function:{name}}"},"parallel_tool_calls":{"type":"boolean","description":"Compatibility hint. Flash accepts this field, but its OpenRouter providers do not advertise it; the gateway omits only this field upstream while preserving native tools/tool_calls."},"stream":{"type":"boolean","default":false},"stream_reliability":{"type":"string","enum":["live","transactional"],"description":"live (default) streams text and tool_calls as they are generated; transactional buffers and validates the complete upstream result before emitting model data"},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}}},"max_tokens":{"type":"integer","minimum":1,"maximum":943718,"description":"Maximum output tokens; the exact per-model limit is returned by GET /v1/models."},"max_completion_tokens":{"type":"integer","minimum":1,"maximum":943718,"description":"Alias of max_tokens; the exact per-model limit is returned by GET /v1/models."},"reasoning":{"description":"Reasoning effort/exclude configuration"},"reasoning_effort":{"type":"string","enum":["none","low","high","xhigh","max"]},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number","minimum":0,"maximum":1},"seed":{"type":"integer"},"stop":{"description":"String or up to four strings"},"user":{"type":"string","maxLength":256}}}}}}