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 nullOptional>=1<=20
echoboolean or nullOptional
frequency_penaltydouble or nullOptional>=-2<=2
logit_biasmap from strings to doubles or nullOptional
logprobsinteger or nullOptional>=0<=5
max_tokensinteger or nullOptional>=1
ninteger or nullOptional>=1<=128
presence_penaltydouble or nullOptional>=-2<=2
seedinteger or nullOptional
stopstring or list of strings or nullOptional
streamboolean or nullOptional
stream_optionsobject or nullOptional
suffixstring or nullOptional
temperaturedouble or nullOptional>=0<=2
top_pdouble or nullOptional>=0<=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