跳到主要内容

通用模型转发

POST /v1/chat/completions

Body 请求参数

{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "What is the meaning of life?"
}
]
}

请求参数

名称位置类型必选说明
AuthorizationheaderstringBearer AIHUBMIX_API_KEY
Content-Typeheaderstringnone
bodybodyobjectnone

返回示例

200 Response

{
"id": "chatcmpl-AzJqsyf2h02BKjrqHMA1HVUQpiDfL",
"model": "gpt-3.5-turbo-0125",
"object": "chat.completion",
"created": 1739177682,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The meaning of life is a philosophical question that has been debated for centuries. Different people and cultures may have different beliefs about the purpose and significance of life. Some believe that the meaning of life is to seek happiness and fulfillment, while others believe in spiritual or religious meanings such as serving a higher power or fulfilling a destiny. Ultimately, the meaning of life may be a deeply personal and individual question that each person must answer for themselves."
},
"finish_reason": "stop"
}
],
"system_fingerprint": "fp_0165350fbb",
"usage": {
"prompt_tokens": 14,
"completion_tokens": 86,
"total_tokens": 100
}
}

返回结果

状态码状态码含义说明数据模型
200OKnoneInline

返回数据结构

数据模型