Skip to content

Audio

CCWAI 支持 OpenAI 兼容的音频接口,包括语音转文字、翻译和文字转语音。

语音转文字

http
POST https://ccwai.tech/v1/audio/transcriptions
Authorization: Bearer YOUR_API_KEY
Content-Type: multipart/form-data
bash
curl https://ccwai.tech/v1/audio/transcriptions \
  -H "Authorization: Bearer $CCWAI_API_KEY" \
  -F model="whisper-1" \
  -F file="@audio.mp3"

音频翻译

http
POST https://ccwai.tech/v1/audio/translations
bash
curl https://ccwai.tech/v1/audio/translations \
  -H "Authorization: Bearer $CCWAI_API_KEY" \
  -F model="whisper-1" \
  -F file="@audio.mp3"

文字转语音

http
POST https://ccwai.tech/v1/audio/speech
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
bash
curl https://ccwai.tech/v1/audio/speech \
  -H "Authorization: Bearer $CCWAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "voice": "alloy",
    "input": "欢迎使用 CCWAI。"
  }' \
  --output speech.mp3

注意事项

上传文件大小、格式和可用模型由上游渠道决定。遇到失败时,先换短音频文件验证。

CCWAI 用户文档