How do I use the Leiolai Responses API?
Use /v1/responses with model: leiolai-1 and input as text or supported typed items. Responses has its own controls for instructions, reasoning.effort, max_output_tokens, text.format, and client-defined function tools. A completed JSON response returns output items; streaming uses typed Responses events. Send relevant prior output and function results back in the next input when continuing.
Read the Leiolai API reference
What is the smallest Responses request?
Send model: leiolai-1 and input as a string or supported typed items. An Unrestricted Leiolai key also requires mode; restricted Private-only and Research-only keys can omit mode.
{
"model": "leiolai-1",
"input": "Explain the difference between context and output.",
"mode": "private"
} Which input types does Responses accept?
Input can be text or typed message, function_call, and function_call_output items. Message content supports input_text, base64 input_image URLs, and supported inline input_file text. Use the documented input types rather than the Leiolai Chat Completions messages shape.
Supported input materialWhere do I read the completed answer?
Leiolai Responses returns an output array containing message or function_call items. Read the output message’s text for a completed answer. A function-call item carries the request your application should execute before returning a matching function result.
Function resultsHow do I continue a Responses conversation?
Send the relevant prior output items back in input on the next request, including function-call items and results when required. The current endpoint does not provide retrievable Leiolai Responses conversation state through previous_response_id or store: true.
What does store: false mean in this format?
Leiolai Responses accepts store: false but does not store retrievable Responses state. To continue, send the relevant prior output items back in input. store: true and previous_response_id return HTTP 400. This field concerns retrievable Responses state, not Leiolai’s chat handling or retention policy.
Which field chooses thinking effort?
Use reasoning.effort with low, medium, high, or xhigh. The default is low. Leiolai Chat Completions uses reasoning_effort instead.
Effort controlsHow do I request JSON with a schema?
Set text.format to json_schema in the Leiolai Responses request. Provide a name and schema, with optional description and strict. For a JSON object without a schema, use json_object. Do not combine structured output with function tools in the same request.
Responses JSON schemasHow do I read a Responses stream?
Set stream: true and process typed events. Text arrives through response.output_text.delta. The terminal event is response.completed, response.incomplete, or response.failed. This stream does not use the Leiolai Chat Completions [DONE] sentinel.
Typed streaming eventsAre hosted tools and background jobs included?
The documented Leiolai Responses format supports client-defined functions and the listed request controls. Hosted tools, background jobs, store: true, previous_response_id, and other unlisted fields return HTTP 400.
Unsupported-field errors