{
  "openapi": "3.1.0",
  "info": {
    "title": "Responses格式",
    "version": "1.0.0",
    "description": "OpenAI Responses API，用于创建模型响应。\n支持多轮对话、工具调用、推理等功能。\n"
  },
  "tags": [
    {
      "name": "聊天（Chat）/原生OpenAI格式"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "使用 Bearer Token 认证。\n格式: `Authorization: Bearer sk-xxxxxx`\n"
      }
    }
  },
  "paths": {
    "/v1/responses": {
      "post": {
        "tags": [
          "聊天（Chat）/原生OpenAI格式"
        ],
        "summary": "Responses格式",
        "description": "OpenAI Responses API，用于创建模型响应。\n支持多轮对话、工具调用、推理等功能。\n",
        "operationId": "createresponse",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model"
                ],
                "properties": {
                  "model": {
                    "type": "string"
                  },
                  "input": {
                    "description": "输入内容，可以是字符串或消息数组",
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {},
                          "x-apifox-orders": []
                        }
                      }
                    ]
                  },
                  "instructions": {
                    "type": "string"
                  },
                  "max_output_tokens": {
                    "type": "integer"
                  },
                  "temperature": {
                    "type": "number"
                  },
                  "top_p": {
                    "type": "number"
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "tools": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {},
                      "x-apifox-orders": []
                    }
                  },
                  "tool_choice": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "object",
                        "properties": {},
                        "x-apifox-orders": []
                      }
                    ]
                  },
                  "reasoning": {
                    "type": "object",
                    "properties": {
                      "effort": {
                        "type": "string",
                        "enum": [
                          "low",
                          "medium",
                          "high"
                        ]
                      },
                      "summary": {
                        "type": "string"
                      }
                    },
                    "x-apifox-orders": [
                      "effort",
                      "summary"
                    ]
                  },
                  "previous_response_id": {
                    "type": "string"
                  },
                  "truncation": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "disabled"
                    ]
                  }
                },
                "x-apifox-orders": [
                  "model",
                  "input",
                  "instructions",
                  "max_output_tokens",
                  "temperature",
                  "top_p",
                  "stream",
                  "tools",
                  "tool_choice",
                  "reasoning",
                  "previous_response_id",
                  "truncation"
                ]
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "成功创建响应",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "object": {
                      "type": "string",
                      "examples": [
                        "response"
                      ]
                    },
                    "created_at": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "completed",
                        "failed",
                        "in_progress",
                        "incomplete"
                      ]
                    },
                    "model": {
                      "type": "string"
                    },
                    "output": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "content": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "text": {
                                  "type": "string"
                                }
                              },
                              "x-apifox-orders": [
                                "type",
                                "text"
                              ]
                            }
                          }
                        },
                        "x-apifox-orders": [
                          "type",
                          "id",
                          "status",
                          "role",
                          "content"
                        ]
                      }
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "prompt_tokens": {
                          "type": "integer",
                          "description": "提示词 Token 数"
                        },
                        "completion_tokens": {
                          "type": "integer",
                          "description": "补全 Token 数"
                        },
                        "total_tokens": {
                          "type": "integer",
                          "description": "总 Token 数"
                        },
                        "prompt_tokens_details": {
                          "type": "object",
                          "properties": {
                            "cached_tokens": {
                              "type": "integer"
                            },
                            "text_tokens": {
                              "type": "integer"
                            },
                            "audio_tokens": {
                              "type": "integer"
                            },
                            "image_tokens": {
                              "type": "integer"
                            }
                          },
                          "x-apifox-orders": [
                            "cached_tokens",
                            "text_tokens",
                            "audio_tokens",
                            "image_tokens"
                          ]
                        },
                        "completion_tokens_details": {
                          "type": "object",
                          "properties": {
                            "text_tokens": {
                              "type": "integer"
                            },
                            "audio_tokens": {
                              "type": "integer"
                            },
                            "reasoning_tokens": {
                              "type": "integer"
                            }
                          },
                          "x-apifox-orders": [
                            "text_tokens",
                            "audio_tokens",
                            "reasoning_tokens"
                          ]
                        }
                      },
                      "x-apifox-orders": [
                        "prompt_tokens",
                        "completion_tokens",
                        "total_tokens",
                        "prompt_tokens_details",
                        "completion_tokens_details"
                      ]
                    }
                  },
                  "x-apifox-orders": [
                    "id",
                    "object",
                    "created_at",
                    "status",
                    "model",
                    "output",
                    "usage"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.xiexus.cn",
      "description": "固定生产地址"
    }
  ]
}
