Does Leiolai support the text Completions API?
Yes. Send a single string prompt to /v1/completions with model set to leiolai-1. The answer appears in choices[0].text. This format works for applications built around a text prompt and a text response; Chat Completions, Responses, and Messages provide richer conversation interfaces.
Read the Leiolai API reference
What does a text Completions request look like?
Use model: leiolai-1 and prompt containing one string. Set max_tokens for the response cap if your application needs a bounded answer. An unrestricted key must also specify mode. Authenticate with your Leiolai key in the Authorization: Bearer header.
Where is the answer in the response?
Read choices[0].text from the Leiolai JSON response. The endpoint returns one choice. Check finish_reason to distinguish a completed answer from a response that reached the output cap.
Can I stream text Completions?
Yes. To stream Leiolai text Completions, set stream to true and append choices[0].text from each data event. The terminal chunk contains an empty text value and a finish_reason, followed by data: [DONE].
Read the correct events for each endpointCan I choose a deeper thinking effort?
Yes. Set reasoning_effort to low, medium, high, or xhigh in a Leiolai text Completions request. Low is the default. The selected effort affects the request’s token rate, so check the pricing table for your chosen mode and effort when estimating costs.
Calculate input and output costsCan I submit an array of prompts or request several choices?
No. Leiolai text Completions accepts one string prompt and n: 1. Send separate requests for separate prompts. Prompt arrays, multiple choices, echo: true, log probabilities, and custom stop sequences are unsupported.
Will the model continue an unfinished sentence exactly?
Leiolai text Completions uses a conversational model, so exact continuation of an unfinished prefix is not guaranteed. Send a complete instruction such as “Rewrite the following paragraph in plain English.” Use Chat Completions when the task needs message roles or conversation history.
Use message roles for a conversationWhich endpoint should I choose for tools or JSON schemas?
Use Leiolai Chat Completions, Responses, or Messages for client-defined functions. Use Chat Completions or Responses for structured JSON output. Text Completions has a single text prompt and answer, with no tool-result or structured-output fields.
Use functions Use a JSON schemaIs continuous generation the same as a text completion stream?
Leiolai continuous generation uses a separate experimental endpoint that keeps a response open while you add context. A normal text completion stream is one bounded response.
Continuous generation and live updates