Create a completion

Creates a completion for the provided prompt and parameters. Supports both streaming and non-streaming modes.

Authentication

AuthorizationBearer
API key as bearer token in Authorization header

Request

Completion request parameters
modelstringRequired
promptstring or list of strings or list of doubles or list of lists of doublesRequired
best_ofinteger or nullOptional1-20
echoboolean or nullOptional
frequency_penaltydouble or nullOptional-2-2
logit_biasmap from strings to doubles or nullOptional
logprobsinteger or nullOptional0-5
max_tokensinteger or nullOptional1-9007199254740991
ninteger or nullOptional1-128
presence_penaltydouble or nullOptional-2-2
seedinteger or nullOptional-9007199254740991-9007199254740991
stopstring or list of strings or nullOptional
streambooleanOptionalDefaults to false
stream_optionsobject or nullOptional
suffixstring or nullOptional
temperaturedouble or nullOptional0-2
top_pdouble or nullOptional0-1
userstringOptional
metadatamap from strings to strings or nullOptional
response_formatobject or nullOptional

Response

Successful completion response
idstring
object"text_completion"
createddouble
modelstring
choiceslist of objects
system_fingerprintstring or null
usageobject or null

Errors