Endpoint
The completions endpoint is considered legacy. Use the Chat Completions endpoint for new applications.
Request
Headers
string
required
Must be
application/jsonstring
required
The AI provider to use
string
required
Your API key for the specified provider
Body Parameters
string
required
The model to use for completion (e.g.,
gpt-3.5-turbo-instruct, text-davinci-003)string | array
required
The prompt(s) to generate completions for
integer
default:16
Maximum number of tokens to generate
number
default:1
Sampling temperature between 0 and 2
number
default:1
Nucleus sampling parameter
integer
default:1
Number of completions to generate
boolean
default:false
Whether to stream the response
string | array
Up to 4 sequences where the API will stop generating
number
default:0
Penalty for token presence (-2.0 to 2.0)
number
default:0
Penalty for token frequency (-2.0 to 2.0)
string
Text to append after the completion
boolean
default:false
Echo back the prompt in addition to the completion
integer
default:1
Generate multiple completions server-side and return the best
integer
Include log probabilities on the most likely tokens
string
Unique identifier for the end-user
Response
string
Unique identifier for the completion
string
Object type, always
text_completioninteger
Unix timestamp of creation
string
The model used for completion
array
object