API 文档

毕力可语音合成服务提供 OpenAI 兼容的 HTTP 接口,几行代码即可接入。

接入概览

所有请求基于 HTTPS,通过请求头中的 API Key 鉴权:

Base URLhttps://baydadam.com/v1
鉴权方式Authorization: Bearer <API Key>

语音合成 POST /v1/audio/speech

将文本合成为语音。支持两种返回格式:pcm 为实时分块流(48kHz、16-bit、单声道 s16le,可边生成边播放,首包延迟低);wav 为完整 WAV 文件,生成结束后一次性返回。

参数类型必填说明
modelstring固定为 yixotts
inputstring待合成文本,单次上限 2000 字符
voicestring音色 ID,从 GET /v1/voices 获取
response_formatstringpcm(默认)或 wav

curl 示例:

curl https://baydadam.com/v1/audio/speech \
  -H "Authorization: Bearer <API Key>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "yixotts",
    "input": "你好,世界。",
    "voice": "zh_female_02_SSB0342",
    "response_format": "pcm"
  }' \
  --output speech.pcm

JavaScript 流式接收示例:

const response = await fetch("https://baydadam.com/v1/audio/speech", {
  method: "POST",
  headers: {
    Authorization: "Bearer <API Key>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "yixotts",
    input: "你好,世界。",
    voice: "zh_female_02_SSB0342",
    response_format: "pcm",
  }),
});

// pcm 为 48kHz 16-bit 单声道 s16le 流,收到即可喂给 AudioContext 播放
const reader = response.body.getReader();
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  // value: Uint8Array PCM 分块
}

音色列表 GET /v1/voices

返回当前可用的全部预置音色(含维吾尔语与中文音色)及其 ID:

curl https://baydadam.com/v1/voices \
  -H "Authorization: Bearer <API Key>"

AI 助手接入(Skill 下载)

把下面的技能文件交给你的 AI 助手(Claude Code / Kimi / Codex 等),它就能直接学会调用 Yixo 语音合成 API。文件内包含接口说明、音色列表与流式播放要点。

说明

  • 单次合成文本上限 2000 字符。
  • 官网匿名体验页按 IP 限流,正式 API Key 不受此限制。
  • 正式 API Key 审核发放,可在 API Keys 页面提交申请;自助领取将随会员系统上线。