The text completions endpoint generates a continuation of a prompt string. This is the legacy (non-chat) format — for new integrations, prefer the Chat Completions API which uses a structured message list and is compatible with all modern models.Documentation Index
Fetch the complete documentation index at: https://doc.hitopen.com/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
Request parameters
The model ID to use. This endpoint is intended for models that support the legacy completions format.
The prompt to generate a completion for. You can pass a single string or an array of strings to generate completions for multiple prompts in one request.
Maximum number of tokens to generate. The prompt tokens plus
max_tokens must not exceed the model’s context length.Sampling temperature between
0 and 2. Lower values produce more focused and deterministic output.Nucleus sampling parameter. The model considers only the tokens comprising the top
top_p probability mass.Number of completions to generate for each prompt.
When
true, tokens are streamed as Server-Sent Events as they are produced, ending with data: [DONE].Up to 4 sequences where generation stops. The model stops before producing any of these sequences.
A string appended after the generated completion. Useful for fill-in-the-middle tasks.
When
true, the prompt is included at the beginning of the returned completion text.Response fields
Unique identifier for the completion.
Always
"text_completion".Unix timestamp (seconds) when the completion was created.
The model that served the request.