1. Audio
梧柏API使用文档
WHBAI · OpenAI 兼容
  • WHBAI · Google Gemini 原生 (v1alpha)
  • WHBAI · Google Gemini 原生
  • WHBAI · Ideogram
  • WHBAI · Ideogram V3
  • WHBAI · Midjourney
  • WHBAI · Jimeng
  • WHBAI · Kling
  • WHBAI · Luma
  • WHBAI · Luma V1
  • WHBAI · Omni 视频
  • WHBAI · Pixverse
  • WHBAI · Runway
  • WHBAI · Sora2
  • WHBAI · 统一视频 VEO
  • WHBAI · Vidu
  • WHBAI · 豆包 Volc
  • WHBAI · Suno
  • WHBAI · Playground
  • WHBAI · 账号与令牌
  • WHBAI · 阿里 Pix
  • WHBAI · 阿里百炼
  • WHBAI · 私域人像
  • WHBAI · Fal.ai
  • WHBAI · Replicate
  • WHBAI · 腾讯云 VOD
  • WHBAI · MiniMax
  • WHBAI · 支持模型列表
  • WHBAI · Grok Imagine
  • WHBAI · Seedance 2.0
  • WHBAI · TypeSafe
  • WHBAI · OpenAI 兼容
  • Chat
    • 对话补全(OpenAI 兼容)
      POST
  • Embeddings
    • 文本嵌入(OpenAI 兼容)
      POST
  • Audio
    • 音频转文字 gpt-4o-transcribe
      POST
    • 创建语音 gpt-4o-mini-tts
      POST
    • 创建翻译(部分模型不支持)
      POST
  • 文生图接口
    • GPT Image-1
      • 创建 gpt-image-2.5
    • Grok
      • 编辑image【"grok-imagine-image-quality" | "grok-imagine-image-2.0"】
  • Models
    • 获取令牌支持模型
      GET
  • Completions
    • 创建完成
      POST
  • Responses
    • 创建函数调用
      POST
    • gpt 上下文压缩
      POST
  • Rerank
    • 重排序
      POST
  • 智能交互
    • TypeSafe
      • TypeSafe System One
  • 谷歌Gemini
    • 原生格式
      • 图片生成 gemini-nano-banana-2.1
  • 品牌平台
    • MINIMAX-V2
      • 创建视频
      • 查询单个任务
  • 数据模型
    • 对话接口 POST /v1/chat/completions
    • V1ChatCompletionsResponse
    • V1EmbeddingsRequest
    • V1EmbeddingsResponse
    • V1AudioSpeechRequest
    • PostV1ImagesGenerationsRequest
    • POST /v1/images/generations · wan2.7-image-pro 成功响应
    • POSTV1ImagesGenerations_DallE2
    • POSTV1ImagesGenerations_GptImage1
    • POSTV1ImagesGenerations_GptImage2
    • POSTV1ImagesGenerations_GptImage25
    • POSTV1ImagesGenerations_GptImage2C
    • POSTV1ImagesGenerations_QwenImageMax
    • POSTV1ImagesGenerations_ZImageTurbo
    • POSTV1ImagesGenerations_QwenImage20260303
    • POSTV1ImagesGenerations_QwenImage3
    • POSTV1ImagesGenerations_QwenImage3Pro
    • POSTV1ImagesEdits_Grok3Image
    • POSTV1ImagesEdits_GptImage1
    • POSTV1ImagesEdits_GptImage2
    • POSTV1ImagesEdits_GptImage25
    • POSTV1ImagesEdits_QwenImageEdit2509
    • POSTV1ImagesGenerations_DallE3
    • POSTV1ImagesGenerations_Grok2Image
    • POSTV1ImagesGenerations_Grok3Image
    • Message
    • ContentPart
    • Tool
    • StreamOptions
    • ResponseFormat
    • WebSearchOptions
    • wan2.7-image-pro 文生图请求
    • imageData
    • PostV1ImagesEditsResponse
    • PostV1CompletionsRequest
    • PostV1CompletionsResponse
    • PostV1ResponsesRequest
    • PostV1ResponsesResponse
    • PostV1ResponsesCompactRequest
    • PostV1RerankRequest
    • PostV1RerankResponse
    • NewApiError
  1. Audio

创建语音 gpt-4o-mini-tts

POST
/v1/audio/speech
官方文档:https://platform.openai.com/docs/guides/text-to-speech

网站中的模型与调用示例#

创建语音 gpt-4o-mini-tts#

官方文档:https://platform.openai.com/docs/guides/text-to-speech

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "input": {
      "description": "要生成音频的文本。最大长度为4096个字符。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The text to generate audio from. The maximum length is 4096 characters."
        }
      }
    },
    "model": {
      "description": "可用的 TTS 模型之一:tts-1 或 tts-1-hd",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "One of the available TTS models: tts-1 or tts-1-hd"
        }
      }
    },
    "response_format": {
      "description": "默认为 mp3 音频的格式。支持的格式有:mp3、opus、aac 和 flac。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The default is mp3 audio format. Supported formats are: mp3, opus, aac and flac."
        }
      }
    },
    "speed": {
      "description": "默认为 1 生成的音频速度。选择0.25到4.0之间的值。1.0是默认值。",
      "type": "number",
      "x-i18n": {
        "en-US": {
          "description": "Defaults to 1. Generated audio speed. Choose a value between 0.25 and 4.0. 1.0 is the default value."
        }
      }
    },
    "voice": {
      "description": "生成音频时使用的语音。支持的语音有:alloy、echo、fable、onyx、nova 和 shimmer。",
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "The voice to use when generating audio. Supported voices are: alloy, echo, fable, onyx, nova and shimmer."
        }
      }
    }
  },
  "required": [
    "model",
    "input",
    "voice"
  ]
}

请求示例 · 示例 1#

{
  "input": "The quick brown fox jumped over the lazy dog.",
  "model": "gpt-4o-mini-tts",
  "voice": "alloy"
}

请求参数

Authorization
Bearer Token
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
or
Body 参数application/json

示例
{
    "model": "gpt-4o-mini-tts",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location '/v1/audio/speech' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "model": "gpt-4o-mini-tts",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
}'

返回响应

🟢200成功
application/json
OK
Bodyapplication/json

示例
{
    "id": "resp_example",
    "object": "response",
    "status": "completed"
}
🟠400请求有误
🟠401没有权限
修改于 2026-10-24 18:33:00
上一页
音频转文字 gpt-4o-transcribe
下一页
创建翻译(部分模型不支持)
Built with