Skip to content

非公式本サイトは非公式の日本語ドキュメントであり、Cloudflare 公式サイトではありません。最新情報はdevelopers.cloudflare.comをご確認ください。

OpenAI のロゴ

TTS-1 HD

テキスト読み上げ • OpenAI

Markdown で表示Agent セットアップ
  • サードパーティ
  • ゼロデータ保持

より高品質な音声を出力する、OpenAI の高精細テキスト読み上げモデルです。

モデル情報
利用規約とライセンスリンク
詳細情報リンク
ゼロデータ保持はい
料金Cloudflare ダッシュボードで料金を見る

使い方

const response = await env.AI.run(
  'openai/tts-1-hd',
  {
    response_format: 'mp3',
    speed: 1,
    text: 'Hello! Welcome to Cloudflare AI Gateway. Let me show you what we can do.',
    voice: 'alloy',
  },
)
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": "openai/tts-1-hd",
  "input": {
    "response_format": "mp3",
    "speed": 1,
    "text": "Hello! Welcome to Cloudflare AI Gateway. Let me show you what we can do.",
    "voice": "alloy"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1-hd/simple-speech.mp3"
  },
  "state": "Completed"
}

ストーリーテリング — Fable 音声による HD ナレーションです
const response = await env.AI.run(
  'openai/tts-1-hd',
  {
    response_format: 'mp3',
    speed: 0.9,
    text: 'Once upon a time, in a kingdom beyond the clouds, there lived a young inventor who dreamed of building machines that could think.',
    voice: 'fable',
  },
)
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": "openai/tts-1-hd",
  "input": {
    "response_format": "mp3",
    "speed": 0.9,
    "text": "Once upon a time, in a kingdom beyond the clouds, there lived a young inventor who dreamed of building machines that could think.",
    "voice": "fable"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1-hd/storytelling.mp3"
  },
  "state": "Completed"
}
ポッドキャスト風 — 会話調のポッドキャストナレーションです
const response = await env.AI.run(
  'openai/tts-1-hd',
  {
    response_format: 'mp3',
    speed: 1,
    text: "So here's the thing about large language models — they're not actually thinking. They're predicting the next token based on patterns in their training data. But the results can be surprisingly coherent.",
    voice: 'echo',
  },
)
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": "openai/tts-1-hd",
  "input": {
    "response_format": "mp3",
    "speed": 1,
    "text": "So here'\''s the thing about large language models — they'\''re not actually thinking. They'\''re predicting the next token based on patterns in their training data. But the results can be surprisingly coherent.",
    "voice": "echo"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1-hd/podcast-style.mp3"
  },
  "state": "Completed"
}
Shimmer 音声 — 明るく表現豊かな声です
const response = await env.AI.run(
  'openai/tts-1-hd',
  {
    response_format: 'mp3',
    speed: 1,
    text: 'Breaking news: scientists have discovered a new species of deep-sea fish that produces its own light using bioluminescence.',
    voice: 'shimmer',
  },
)
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": "openai/tts-1-hd",
  "input": {
    "response_format": "mp3",
    "speed": 1,
    "text": "Breaking news: scientists have discovered a new species of deep-sea fish that produces its own light using bioluminescence.",
    "voice": "shimmer"
  }
}'
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/openai__tts-1-hd/shimmer-voice.mp3"
  },
  "state": "Completed"
}

パラメーター

text
string必須maxLength: 4096音声を生成するテキストです。最大 4096 文字です。
voice
string必須デフォルト: alloyenum: alloy, echo, fable, onyx, nova, shimmer音声生成に使う voice です。デフォルトは alloy です。
response_format
string必須デフォルト: mp3enum: mp3, opus, wav, aac, flac音声の出力形式です。対応形式は mp3、opus、wav、aac、flac です。
speed
number必須デフォルト: 1minimum: 0.25maximum: 4生成音声の速度です。0.25〜4.0 から選びます。デフォルトは 1.0 です。
audio
string生成された音声ファイルの URL です

API スキーマ(Raw)

Input
Output

役に立ちましたか?