gpt-3.5-turbo-instruct
Method: POSTEndpoint: /v1/completions
Given a prompt, the model returns one or more predicted completions and can also return the probabilities of alternative tokens at each position.
Create a completion for the provided prompt and parameters.
Request Parameters
Header Parameters
text
Authorization
string
Optional
Default Value:
Bearer {{YOUR_API_KEY}}Body Parameters application/json
text
model
string
Required
The ID of the model to use. You can use
List models
the API to view all available models, or review our
model overview
to understand their descriptions.
prompt
string
Required
// provider-specific example normalized for English documentation
best_of
integer
Optional
// provider-specific example normalized for English documentation
echo
boolean
Optional
// provider-specific example normalized for English documentation
frequency_penalty
number
Optional
// provider-specific example normalized for English documentation
logit_bias
object
Optional
// provider-specific example normalized for English documentation
logprobs
null
Optional
// provider-specific example normalized for English documentation
// provider-specific example normalized for English documentation
// provider-specific example normalized for English documentation
max_tokens
integer
Optional
// provider-specific example normalized for English documentation
// provider-specific example normalized for English documentation
// provider-specific example normalized for English documentation
n
integer
Optional
// provider-specific example normalized for English documentation
// provider-specific example normalized for English documentation
// provider-specific example normalized for English documentation
presence_penalty
number
Optional
// provider-specific example normalized for English documentation
seed
integer
Optional
// provider-specific example normalized for English documentation
stop
string
Optional
// provider-specific example normalized for English documentation
stream
boolean
Optional
// provider-specific example normalized for English documentation
suffix
string
Optional
// provider-specific example normalized for English documentation
temperature
integer
Optional
// provider-specific example normalized for English documentation
user
string
Required
top_p
integer
Optional
// provider-specific example normalized for English documentation
Example
{
"model"
:
"gpt-3.5-turbo-instruct"
,
"prompt"
:
"Say this is a test"
,
"max_tokens"
:
7
,
"temperature"
:
0
}Example Request
Shell
bash
curl --location --request POST '/v1/completions' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "gpt-3.5-turbo-instruct",
"prompt": "Say this is a test",
"max_tokens": 7,
"temperature": 0
}'Response
🟢 200 Ok
Content Type: application/json
Response Schema
text
id
string
Required
object
string
Required
created
integer
Required
model
string
Required
system_fingerprint
string
Required
choices
array
[object]
Required
text
string
Optional
index
integer
Optional
logprobs
null
Optional
finish_reason
string
Optional
usage
object
Required
prompt_tokens
integer
Required
completion_tokens
integer
Required
total_tokens
integer
RequiredExample
json
{
"id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
"object": "text_completion",
"created": 1589478378,
"model": "gpt-3.5-turbo-instruct",
"system_fingerprint": "fp_44709d6fcb",
"choices": [
{
"text": "\n\nThis is indeed a test",
"index": 0,
"logprobs": null,
"finish_reason": "length"
}
],
"usage": {
"prompt_tokens": 5,
"completion_tokens": 7,
"total_tokens": 12
}
}