Maisi-AI API Doc
首页全部
OpenAI语言模型图像模型视频模型音频模型
首页全部
OpenAI语言模型图像模型视频模型音频模型
  1. OpenAI
  • 语言模型
    • Claude
      • Anthropic Messages
    • OpenAI
      • Chat聊天接口
        POST
      • Response
        POST
    • Gemini
      • 聊天接口(非流)
      • 聊天接口(流式)
  • 图像模型
  • 视频模型
    • 国产视频模型说明文档
  • 音频模型
  • 平台接口
  1. OpenAI

Chat聊天接口

POST
/v1/chat/completions
OpenAI Chat Completions API
文档有滞后性,最新文档见:https://platform.openai.com/docs/api-reference/chat/create

请求参数

Header 参数

Body 参数application/json必填

示例

返回响应

🟢200成功
application/json
Body

请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1/chat/completions' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{}'
响应示例响应示例
{
    "id": "string",
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "message": {
                "content": "string",
                "refusal": "string",
                "tool_calls": [
                    {
                        "id": "string",
                        "type": "function",
                        "function": {
                            "name": "string",
                            "arguments": "string"
                        }
                    }
                ],
                "annotations": [
                    {
                        "type": "url_citation",
                        "url_citation": {
                            "end_index": 0,
                            "start_index": 0,
                            "url": "string",
                            "title": "string"
                        }
                    }
                ],
                "role": "assistant",
                "function_call": {
                    "arguments": "string",
                    "name": "string"
                },
                "audio": {
                    "id": "string",
                    "expires_at": 0,
                    "data": "string",
                    "transcript": "string"
                }
            },
            "logprobs": {
                "content": [
                    {
                        "token": "string",
                        "logprob": 0,
                        "bytes": [
                            0
                        ],
                        "top_logprobs": [
                            {
                                "token": "string",
                                "logprob": 0,
                                "bytes": [
                                    0
                                ]
                            }
                        ]
                    }
                ],
                "refusal": [
                    {
                        "token": "string",
                        "logprob": 0,
                        "bytes": [
                            0
                        ],
                        "top_logprobs": [
                            {
                                "token": "string",
                                "logprob": 0,
                                "bytes": [
                                    0
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    ],
    "created": 0,
    "model": "string",
    "service_tier": "auto",
    "system_fingerprint": "string",
    "object": "chat.completion",
    "usage": {
        "completion_tokens": 0,
        "prompt_tokens": 0,
        "total_tokens": 0,
        "completion_tokens_details": {
            "accepted_prediction_tokens": 0,
            "audio_tokens": 0,
            "reasoning_tokens": 0,
            "rejected_prediction_tokens": 0
        },
        "prompt_tokens_details": {
            "audio_tokens": 0,
            "cached_tokens": 0
        }
    }
}
修改于 2026-04-15 09:27:27
上一页
Anthropic Messages
下一页
Response
Built with