1. Skyblight text to speech
MyVocal AI语音大模型API文档
English
  • 中文
  • English
  • 文字转语音大模型
    • API reference
      • Voice management
        • List voices
        • Create a voice
        • Delete a voice
      • HTTP synthesis
        • Streaming HTTP synthesis
        • Non-streaming HTTP synthesis
      • WebSocket synthesis
        • Standard TTS · Single connection
        • Standard TTS · Multiple contexts
        • Dialogue · Multiple contexts
      • Usage and request history
        • Get master key usage
        • Look up a request by ID
        • Get usage by voice
      • Sub-key management
        • Create a sub-key
        • List sub-keys
        • Get sub-key details
        • Update a sub-key
        • Get sub-key usage
    • Overview and quickstart
      • Models
      • Choose a model and endpoint
      • Supported languages
      • Audio formats and playback
      • FAQ
      • SDKs and examples
  • 金融行业定制TTS模型
    • Skyblight text to speech
      • Streaming text to speech
        POST
      • Non-streaming text to speech
        POST
      • List voices
        GET
      • Delete a voice
        DELETE
      • Create a voice
        POST
      • Get usage
        GET
    • Full-duplex communication
      • WebSocket integration guide
      • V2 bidirectional streaming synthesis (WebSocket)
  • 语音转文字ASR
    • Overview and quickstarts
      • Realtime transcription quickstart
      • File transcription quickstart
      • Models and capabilities
      • Changelog
    • API reference
      • Realtime transcription over WebSocket
      • Create a file transcription
      • Get ASR usage
  • 企业客户声音定制服务
    • Your custom brand voice
  1. Skyblight text to speech

Non-streaming text to speech

POST
https://openapi.myvocal.ai/v2/ai/speech/tts
Returns a complete audio file for download or storage.
Use cases: audio downloads, content archiving, offline playback and batch generation.
Endpoint:POST https://openapi.myvocal.ai/v2/ai/speech/tts
Models, languages and formats: see the TTS overview.

Quickstart#

1.
Select your programming language on the right and copy the request example.
2.
Replace YOUR_API_KEY and <VOICE_ID> with your values.
3.
Set your text, model, language and audio format, then send the request.

Successful response#

HTTP 200 with the complete binary audio file. Save it using the extension corresponding to the requested format.
Read successful responses as binary audio. format selects the output encoding.

Parameter tips#

The parameter table below defines this endpoint’s request. Common settings:
voice, text and model are required.
Set language explicitly when known. If omitted, the service infers it from the text.
Choose a format supported by the model.
sample_rate is in Hz. With ulaw for phone audio, 8000 is common.
Use lowercase seed. Reusing it with the same text and settings improves consistency across generations.
Most applications can use priority set to auto.

Common errors#

HTTP statusCommon causeWhat to do
400Invalid field type, model, language or audio formatCheck request parameters and model compatibility.
401 / 403Invalid API key or insufficient permissionsCheck the API-Key header and account permissions.
429Rate or concurrency limit reachedReduce request frequency and retry later.
5xxService temporarily unavailableRecord the request time and retry later.

Related documentation#

TTS overview
List voices
Streaming text to speech

请求参数

Header 参数

Body 参数application/json

示例

返回响应

🟢200Success: binary audio
application/octet-stream
Complete binary audio file. Save or play it according to the requested format. Do not parse as JSON.
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location 'https://openapi.myvocal.ai/v2/ai/speech/tts' \
--header 'API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
  "voice": "<VOICE_ID>",
  "text": "您好,这是一次语音文件生成测试。",
  "model": "Skyblight-Turbo",
  "language": "zh",
  "format": "wav",
  "sample_rate": 24000,
  "priority": "auto"
}'
上一页
Streaming text to speech
下一页
List voices
Built with