OpenAI-Compatible API
Text Completions
OpenAI-compatible text completions (legacy prompt format)
POST
Text Completions
Documentation Index
Fetch the complete documentation index at: https://student-213fb9fc.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Generate a text completion for a single prompt string. This is the legacy OpenAI-compatible format. For most use cases, prefer the Chat Completions endpoint.Request
Headers
Bearer token:
Bearer YOUR_API_KEYBody
Model identifier. See available models.
The prompt to complete. Can be a string or an array of strings for batch completions.
Stream the completion as Server-Sent Events.
Maximum number of tokens to generate.
Sampling temperature (0–2).
Nucleus sampling probability.
Stop sequences.
Response
Unique completion ID.
"text_completion"Unix timestamp.
The model used.
Completion results:
text— generated textindex— choice indexfinish_reason—"stop"or"length"
Token usage:
prompt_tokens, completion_tokens, total_tokens.