- サードパーティ
- ゼロデータ保持
| モデル情報 | |
|---|---|
| ゼロデータ保持 | はい |
| 料金 | Cloudflare ダッシュボードで料金を見る ↗ |
const response = await env.AI.run(
'google/gemini-3.1-flash-tts',
{ text: 'Hello, welcome to Cloudflare AI Gateway!' },
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "google/gemini-3.1-flash-tts",
"input": {
"text": "Hello, welcome to Cloudflare AI Gateway!"
}
}'{
"audio": "data:audio/l16;base64,...",
"gatewayMetadata": {
"keySource": "Unified"
}
}カスタム音声 — 特定の音声で発話を生成します
const response = await env.AI.run(
'google/gemini-3.1-flash-tts',
{ text: 'The quick brown fox jumps over the lazy dog.', voice: 'Puck' },
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "google/gemini-3.1-flash-tts",
"input": {
"text": "The quick brown fox jumps over the lazy dog.",
"voice": "Puck"
}
}'{
"audio": "data:audio/l16;base64,...",
"gatewayMetadata": {
"keySource": "Unified"
}
}長めのテキスト — 長めのテキストを音声に変換します
const response = await env.AI.run(
'google/gemini-3.1-flash-tts',
{
text: 'Artificial intelligence has transformed the way we interact with technology. From voice assistants to autonomous vehicles, AI is reshaping our daily lives and creating new possibilities for innovation.',
voice: 'Charon',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "google/gemini-3.1-flash-tts",
"input": {
"text": "Artificial intelligence has transformed the way we interact with technology. From voice assistants to autonomous vehicles, AI is reshaping our daily lives and creating new possibilities for innovation.",
"voice": "Charon"
}
}'{
"audio": "data:audio/l16;base64,...",
"gatewayMetadata": {
"keySource": "Unified"
}
}語り口の音声 — 語り口の音声スタイルで発話を生成します
const response = await env.AI.run(
'google/gemini-3.1-flash-tts',
{
text: 'Once upon a time, in a kingdom far away, there lived a brave knight who sought to protect the realm from all dangers.',
voice: 'Kore',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "google/gemini-3.1-flash-tts",
"input": {
"text": "Once upon a time, in a kingdom far away, there lived a brave knight who sought to protect the realm from all dangers.",
"voice": "Kore"
}
}'{
"audio": "data:audio/l16;base64,...",
"gatewayMetadata": {
"keySource": "Unified"
}
}text
string必須maxLength: 10000音声に変換するテキストです。最大 10,000 文字です。voice
stringenum: Zephyr, Puck, Charon, Kore, Fenrir, Leda, Orus, Aoede, Callirrhoe, Autonoe, Enceladus, Iapetus, Umbriel, Algieba, Despina, Erinome, Algenib, Rasalgethi, Laomedeia, Achernar, Alnilam, Schedar, Gacrux, Pulcherrima, Achird, Zubenelgenubi, Vindemiatrix, Sadachbia, Sadaltager, Sulafat音声合成に使う voice ですtemperature
numberminimum: 0maximum: 2生成のランダムさを制御します(0〜2)topP
numberminimum: 0maximum: 1Nucleus sampling のしきい値です(0〜1)。累積確率が `topP` までのトークンを候補にしますtopK
integerexclusiveMinimum: 0maximum: 9007199254740991上位 K 個のトークンからのみサンプリングします。K が小さいほど焦点が絞られ、大きいほど多様になりますmaxOutputTokens
integerexclusiveMinimum: 0maximum: 9007199254740991生成するトークンの最大数です▶stopSequences[]
arrayモデルがこれ以上トークンを生成しなくなるシーケンスですaudio
stringBase64 エンコードした音声データです(WAV 形式)