Skip to content

GPT-4o-audio

OpenAPI Specification

yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/chat/completions:
    post:
      summary: GPT-4o-audio
      deprecated: false
      description: 官方文档:https://platform.openai.com/docs/api-reference/chat/create
      tags:
        - 聊天(Chat)/ChatGpt 接口/ChatGPT音频(Audio)
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Authorization
          in: header
          description: ''
          required: true
          example: Bearer $OPENAI_API_KEY
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: 要使用的模型 ID。
                modalities:
                  type: array
                  items:
                    type: string
                  description: >-
                    模型生成的输出类型。默认设置:["text"]。要请求此模型生成文本和音频响应,您可以使用:["text",
                    "audio"]。
                audio:
                  type: object
                  properties:
                    voice:
                      type: string
                      description: >-
                        模型用于响应支持的语音有alloy, ash, ballad, coral, echo, fable,
                        nova, onyx, sage,或者 shimmer。
                    format:
                      type: string
                      description: 指定输出音频格式必须是wav, mp3, flac, opus, 或者 pcm16。
                  required:
                    - voice
                    - format
                  x-apifox-orders:
                    - voice
                    - format
                  description: 音频输出参数。
                messages:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                      content:
                        type: string
                        description: 消息内容。
                    x-apifox-orders:
                      - role
                      - content
                    required:
                      - role
                      - content
                  description: 构成当前对话的消息列表。
              required:
                - model
                - messages
              x-apifox-orders:
                - model
                - modalities
                - audio
                - messages
            example:
              model: gpt-4o-audio-preview
              modalities:
                - text
                - audio
              audio:
                voice: alloy
                format: wav
              messages:
                - role: user
                  content: Is a golden retriever a good family dog?
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
          headers: {}
          x-apifox-name: 成功
      security:
        - bearer: []
      x-apifox-folder: 聊天(Chat)/ChatGpt 接口/ChatGPT音频(Audio)
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/5443236/apis/api-258427485-run
components:
  schemas: {}
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://www.anyapi.vip
    description: 正式环境
security:
  - bearer: []

AnyAPI — 专业的 AI 接口聚合服务