Make a request
YOUR_API_KEY
with your secret API key.
gpt-3.5-turbo
model. You should receive a response similar to the following:{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1677858242,
"model": "gpt-3.5-turbo-0301",
"usage": {
"prompt_tokens": 13,
"completion_tokens": 7,
"total_tokens": 20
},
"choices": [
{
"message": {
"role": "assistant",
"content": "\n\nThis is a test!"
},
"finish_reason": "stop",
"index": 0
}
]
}
finish_reason
is stop
, which means the API returned a complete response generated by the model. In the above request, we generated only one message, but you can configure the n
parameter to generate multiple message options.gpt-3.5-turbo
is used primarily for traditional text completion tasks. The model is also optimized for chat-based applications.