文档提示:本目录为静态文档,接口示例与 OpenAPI 地址已固定为 https://api.xiexus.cn
AI 模型接口 实时语音(Realtime) 原生OpenAI格式

原生OpenAI格式

建立 WebSocket 连接用于实时对话。 **注意**: 这是一个 WebSocket 端点,需要使用 WebSocket 协议连接。 连接 URL 示例: `wss://api.example.com/v1/realtime?model=gpt-4o-realtime`

GET
https://api.xiexus.cn/v1/realtime
请求体:无
接口信息
方法
GET
路径
/v1/realtime
完整地址
https://api.xiexus.cn/v1/realtime
请求体
标签
实时语音(Realtime)
响应码
101400
当前接口页内已嵌入 OpenAPI JSON;如果需要查看总文件,可直接打开固定静态文件 relay.json
当前 JSON
../../openapi/generated/ai-model/实时语音(Realtime)/get-v1-realtime-createrealtimesession-383826490.json
总文件
../../openapi/relay.json

OpenAPI JSON

已将服务地址固定为 https://api.xiexus.cn,其余结构保持和源文档一致。
{
  "openapi": "3.1.0",
  "info": {
    "title": "原生OpenAI格式",
    "version": "1.0.0",
    "description": "建立 WebSocket 连接用于实时对话。\n\n**注意**: 这是一个 WebSocket 端点,需要使用 WebSocket 协议连接。\n\n连接 URL 示例: `wss://api.example.com/v1/realtime?model=gpt-4o-realtime`\n"
  },
  "tags": [
    {
      "name": "实时语音(Realtime)"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "使用 Bearer Token 认证。\n格式: `Authorization: Bearer sk-xxxxxx`\n"
      }
    }
  },
  "paths": {
    "/v1/realtime": {
      "get": {
        "tags": [
          "实时语音(Realtime)"
        ],
        "summary": "原生OpenAI格式",
        "description": "建立 WebSocket 连接用于实时对话。\n\n**注意**: 这是一个 WebSocket 端点,需要使用 WebSocket 协议连接。\n\n连接 URL 示例: `wss://api.example.com/v1/realtime?model=gpt-4o-realtime`\n",
        "operationId": "createrealtimesession",
        "parameters": [
          {
            "name": "model",
            "in": "query",
            "required": false,
            "description": "要使用的模型",
            "schema": {
              "type": "string",
              "examples": [
                "gpt-4o-realtime-preview"
              ]
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "101": {
            "description": "WebSocket 协议切换"
          },
          "400": {
            "description": "请求错误",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "message": {
                          "type": "string",
                          "description": "错误信息"
                        },
                        "type": {
                          "type": "string",
                          "description": "错误类型"
                        },
                        "param": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "相关参数"
                        },
                        "code": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "错误代码"
                        }
                      },
                      "x-apifox-orders": [
                        "message",
                        "type",
                        "param",
                        "code"
                      ]
                    }
                  },
                  "x-apifox-orders": [
                    "error"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.xiexus.cn",
      "description": "固定生产地址"
    }
  ]
}