Skip to main content
POST

Headers

string
required
Bearer token authentication. Format: Authorization: Bearer sk-xxxxxx

Body

Format: application/json
string
required
Model ID
string | string[]
required
Prompt text, can be a string or an array of strings
integer
Maximum number of tokens to generate
number
Sampling temperature
number
Nucleus sampling parameter
integer
Number of completions to generate
boolean
Whether to stream the response
string | string[]
Stop sequence(s)
string
Suffix text for insertion
boolean
Whether to echo the prompt text in the output

Response

200 Successfully created response

Format: application/json
string
Completion ID
string
Object type, value is text_completion
integer
Creation timestamp
string
Model ID
object[]
List of generated results
object
Token usage information
Last modified on October 28, 2026