POST
/
audio
/
speech
curl --request POST \
  --url https://api.ap.siliconflow.com/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "FunAudioLLM/CosyVoice2-0.5B",
  "input": "Can you say it with a happy emotion? <|endofprompt|>I'\''m so happy, Spring Festival is coming!",
  "voice": "FunAudioLLM/CosyVoice2-0.5B:alex",
  "response_format": "mp3",
  "sample_rate": 123,
  "stream": true,
  "speed": 1,
  "gain": 0
}'
This response does not have an example.

Authorizations

Authorization
string
header
required

Use the following format for authentication: Bearer <your api key>

Body

application/json

Response

200
application/audio
Generate audio based on the input text. The data generated by the interface is in binary format and requires the user to process it themselves. Reference:https://docs.siliconflow.com/capabilities/text-to-speech#5

The response is of type file.