使用 AceDataCloud API 通过 Fish Audio 生成 AI 音频并合成语音。适用于文字转语音、语音合成或生成音频等场景。
Generate narration / voiceover through AceDataCloud's Fish Audio API.
clawhub install @acedatacloud/fish-audio. Check that the ClawHub publisher is @acedatacloud.Bearer ; a platform-... management token is not a service API key./fish/tts (and /fish/tasks for asynchronous TTS). Advanced workflows below may call additional routes.ACEDATACLOUD_API_TOKEN=your_api_key_here in ~/.openclaw/.env, then restart the Gateway and start a new session. For a direct terminal test, run export ACEDATACLOUD_API_TOKEN="your_api_key_here" in that shell. Never put the key in a prompt or commit an .env file.Illustrated key setup, first run, and troubleshooting · Token details
bash
curl -X POST https://api.acedata.cloud/fish/tts \
-H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN" \
-H "Content-Type: application/json" \
-H "model: s2-pro" \
-d '{"text":"你好,欢迎使用 AceData Cloud。","reference_id":"d7900c21663f485ab63ebdb7e5905036","format":"mp3"}'
Synchronous responses return a direct audio URL:
json
{"audio_url":"https://platform.r2.fish.audio/task/8a72ff9840234006a9f74cb2fa04f978.mp3"}
EndpointPurposePOST /fish/ttsText-to-speech generationGET /fish/modelBrowse/search public Fish reference voicesGET /fish/model/{id}Fetch one reference voice by IDPOST /fish/tasksPoll async TTS jobs when async: true
bash
curl "https://api.acedata.cloud/fish/model?page_size=10&page_number=1&title=Marcus" \
-H "Authorization: Bearer $ACEDATACLOUD_API_TOKEN"
The response includes items[] with public voice metadata such as _id, title,
languages, tags, visibility, and state. Use an item _id as
reference_id in TTS requests.
json
POST /fish/tts
Headers:
model: s2-pro
{
"text": "Your narration text.",
"reference_id": "d7900c21663f485ab63ebdb7e5905036",
"format": "mp3"
}
Use a temporary reference voice without creating a persistent model:
json
POST /fish/tts
Headers:
model: s2-pro
{
"text": "New speech in the referenced voice.",
"format": "mp3",
"references": [{
"audio": "https://cdn.acedata.cloud/reference.mp3",
"text": "The exact words spoken in the reference audio."
}]
}
audio must be a public HTTPS MP3/WAV URL and text must be the exact transcript. Use one reference lasting 10–270 seconds. Do not combine references with reference_id; use reference_id when the same saved/public voice will be reused. Raw bytes, Base64, data URIs, and MessagePack are not accepted by the AceDataCloud endpoint.
json
POST /fish/tts
Headers:
model: s1
{
"text": "Longer narration for background processing.",
"callback_url": "https://your-domain.example/fish-webhook"
}
Use an actual public webhook that you operate; replace the example URL. If you
do not have one, use the synchronous Quick Start above. After an asynchronous
submission returns a task ID, see async task polling and query POST /fish/tasks with {"id":"..."}.
/fish/tts#ParameterValuesDescriptionmodel``"s1", "s2-pro", "s2.1-pro"Fish TTS engine selection
ParameterType / ValuesDescriptiontextstringText to synthesize (required)reference_idstringPublic/reference voice ID from GET /fish/model``format``"mp3", "wav", "pcm"Output formatsample_rateintegerOptional output sample ratemp3_bitrate``64, 128, 192MP3 bitratelatency``"normal", "balanced"TTS latency modechunk_length / min_chunk_lengthintegerChunking controlstemperature, top_p, repetition_penaltynumberSampling controlsmax_new_tokensintegerMaximum generated tokensnormalizebooleanNormalize generated audioprosodyobjectProsody tuningreferencesarrayOne {audio, text} object for a one-shot voice clone; mutually exclusive with reference_id``callback_urlstringAsync callback URLasyncbooleanRun asynchronously and poll /fish/tasks
POST /fish/tts — not /fish/audios.model request header, not a JSON model field.reference_id from GET /fish/model — not voice_id.references for a one-shot clone that is not saved as a model.audio_url directly; async jobs should be polled via /fish/tasks.