灵活的参数配置
可配置文档中列出的 6 个参数,包括 bitrate_kbps, output_format, references, sample_rate_hz, text。
curl -X POST https://runapi.ai/api/v1/fish_audio/text_to_speech \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "s2.1-pro",
"text": "将这段简短纪录片旁白转换为富有表现力、节奏稳定的自然语音。"
}'
import { FishAudioClient } from "@runapi.ai/fish-audio";
const client = new FishAudioClient();
const result = await client.textToSpeech.run({
model: "s2.1-pro",
text: "将这段简短纪录片旁白转换为富有表现力、节奏稳定的自然语音。",
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/fish_audio/text_to_speech",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"s2.1-pro","text":"将这段简短纪录片旁白转换为富有表现力、节奏稳定的自然语音。"}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/fish_audio/text_to_speech");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 's2.1-pro',
'text' => '将这段简短纪录片旁白转换为富有表现力、节奏稳定的自然语音。',
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.textToSpeech().run({"model":"s2.1-pro","text":"将这段简短纪录片旁白转换为富有表现力、节奏稳定的自然语音。"});
task.waitForResult();
require "runapi/fish_audio"
client = RunApi::FishAudio::Client.new
result = client.text_to_speech.run(
model: "s2.1-pro",
text: "将这段简短纪录片旁白转换为富有表现力、节奏稳定的自然语音。"
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.textToSpeech.Run({"model":"s2.1-pro","text":"将这段简短纪录片旁白转换为富有表现力、节奏稳定的自然语音。"})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model s2.1-pro \
--endpoint text_to_speech \
--wait
3 个版本可用
选择任意模型,几秒内开始生成。
选择任意模型,几秒内开始生成。
| 提供商 | Fish Audio |
| 模型 ID | s2.1-pro |
| 模态 | Audio & Music |
| 任务类型 | Synchronous |
| API 端点 | /api/v1/fish_audio/text_to_speech |
| 计费单位 | 1K UTF-8 bytes |
| 输入参数 | bitrate_kbps, model, output_format, references, sample_rate_hz, text, voice_id |
| 输出格式 | mp3, wav |
| 目录状态 | 运行中 |
免费注册后,在控制台创建用于 s2.1-pro 的 API 密钥。
向 /api/v1/fish_audio/text_to_speech 发送 POST 请求,并传入 s2.1-pro 模型 ID 和参数。
直接从端点读取已完成的 s2.1-pro 响应。
可配置文档中列出的 6 个参数,包括 bitrate_kbps, output_format, references, sample_rate_hz, text。
提供 1 个公开 endpoint:text_to_speech。
按 1K UTF-8 bytes 计量,无需订阅。
text暂无描述。
voice_id暂无描述。
referencesInline reference audio samples for this request.
bitrate_kbpsMP3 bitrate. Not accepted for WAV output. (64, 128, 192)
output_formatOutput audio format. (mp3, wav)
sample_rate_hzOutput sample rate. MP3 supports 32000 and 44100 Hz; WAV supports every listed value. (8000, 16000, 24000, 32000, 44100)
生成与节目氛围匹配的免版税背景音乐,无需授权费用。
为程序化生成的关卡生成自适应环境音效和配乐。
无需录音棚即可为客户广告生成定制配音和音效。
传入 quickstart 中显示的模型 ID。
Key 级限流随使用层级伸缩。当前限制见定价页。
可以——变体只是参数,改 model 字段即可。
模型支持流式时,RunAPI 端到端流式。
在公共 GitHub 仓库提 issue 或邮件联系 support。