Create a text completion
Completes a text prompt. Set stream to true to receive JSON chunks as server-sent events; the stream ends with data: [DONE].
Authentication
AuthorizationBearer
Mixlayer API key or console user session supplied as a Bearer token.
Request
Completion parameters
model
Model identifier to use for generation.
prompt
Text prompt to complete.
max_tokens
Maximum number of tokens to generate.
stop
Strings that stop generation when encountered.
stream
When true, return server-sent events and terminate with data: [DONE].
stream_options
temperature
Sampling temperature. Higher values make output more random.
top_k
Restricts sampling to the highest-probability tokens.
Response
A complete response or a stream of completion chunks, selected by the request’s stream field
choices
Generated completion choices.
created
Unix timestamp when the completion was created.
id
Unique identifier for the completion.
model
Model used to generate the completion.
object
Object type, always text_completion.
usage
Token usage for the request.
Errors
400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error