gpt-3.5-turbo
POST
/v1/chat/completions请求参数
Header Params
Authorization
string
optional
Example:
{{KEY}}
Body Params application/json
model
string
required
response_format
object
required
type
string
required
messages
array [object {2}]
required
role
string
required
content
string
required
Example
{
"model": "gpt-3.5-turbo",
"response_format": {
"type": "json_object"
},
"messages": [
{
"role": "system",
"content": "You are a helpful assistant designed to output JSON."
},
{
"role": "user",
"content": "Who won the world series in 2020?"
}
]
}
示例代码
Responses
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
Data Schema
id
string
required
object
string
required
created
integer
required
model
string
required
choices
array [object {4}]
required
index
integer
optional
message
object
optional
logprobs
null
optional
finish_reason
string
optional
usage
object
required
prompt_tokens
integer
required
completion_tokens
integer
required
total_tokens
integer
required
system_fingerprint
string
required
Example
{
"id": "chatcmpl-9CTQJmIvA1d30bwWgdhQ0lW6z88hI",
"object": "chat.completion",
"created": 1712760067,
"model": "gpt-3.5-turbo-0125",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n{\n \"error\": \"I'm sorry, but the World Series is not a fixed event, and I cannot provide real-time information. You may want to search online for the latest winner.\"\n}"
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 31,
"completion_tokens": 41,
"total_tokens": 72
},
"system_fingerprint": "fp_b28b39ffa8"
}
Last modified: 7 个月前