Skip to content

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

OpenAI のロゴ

GPT-4o Transcribe

音声認識 • OpenAI

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

GPT-4o を使って音声を文字起こしする音声認識モデルです。元の Whisper モデルと比べて、単語誤り率と言語認識が向上しています。

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

使い方

const response = await env.AI.run(
  'openai/gpt-4o-transcribe',
  { file: 'data:audio/wav;base64,<...>' },
)
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/gpt-4o-transcribe",
  "input": {
    "file": "data:audio/wav;base64,<...>"
  }
}'
Hello
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "text": "Hello"
  },
  "state": "Completed"
}

言語ヒントあり — 精度向上のため、言語ヒント付きで文字起こしします
const response = await env.AI.run(
  'openai/gpt-4o-transcribe',
  { file: 'data:audio/wav;base64,<...>', language: 'en' },
)
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/gpt-4o-transcribe",
  "input": {
    "file": "data:audio/wav;base64,<...>",
    "language": "en"
  }
}'
Hello
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "text": "Hello"
  },
  "state": "Completed"
}
ガイド付き文字起こし — プロンプトで文字起こしのスタイルとコンテキストを案内します
const response = await env.AI.run(
  'openai/gpt-4o-transcribe',
  {
    file: 'data:audio/wav;base64,<...>',
    prompt: 'This is a technical discussion about Kubernetes and cloud-native architecture.',
    language: 'en',
  },
)
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/gpt-4o-transcribe",
  "input": {
    "file": "data:audio/wav;base64,<...>",
    "prompt": "This is a technical discussion about Kubernetes and cloud-native architecture.",
    "language": "en"
  }
}'
This is a technical discussion about Kubernetes and cloud-native architecture.
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "text": "This is a technical discussion about Kubernetes and cloud-native architecture."
  },
  "state": "Completed"
}
高い temperature — より多様な文字起こしのために、高い `temperature` を使います
const response = await env.AI.run(
  'openai/gpt-4o-transcribe',
  { file: 'data:audio/wav;base64,<...>', temperature: 0.5 },
)
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/gpt-4o-transcribe",
  "input": {
    "file": "data:audio/wav;base64,<...>",
    "temperature": 0.5
  }
}'
Hello, world!
{
  "gatewayMetadata": {
    "keySource": "Unified"
  },
  "result": {
    "text": "Hello, world!"
  },
  "state": "Completed"
}

パラメーター

file
string必須音声ファイルです。data URI(`data:audio/...;base64,...`)または HTTPS URL です。対応形式: flac、mp3、mp4、mpeg、mpga、m4a、ogg、wav、webm。
language
string入力音声の言語です。ISO-639-1 形式で指定すると、精度とレイテンシが改善します。
prompt
stringモデルのスタイルを案内する、または前の音声セグメントを続ける任意のテキストです。プロンプトは音声の言語に合わせてください。
temperature
numberminimum: 0maximum: 1サンプリング temperature です(0〜1)。0.8 のように高いとよりランダム、0.2 のように低いとより焦点が絞られ決定的になります。省略時は 0 です。
text
string書き起こしたテキストです。

API スキーマ(Raw)

Input
Output

役に立ちましたか?