メインコンテンツへスキップ
POST
/
v1
/
audio
/
transcriptions
curl -X POST "https://api.lemondata.cc/v1/audio/transcriptions" \
  -H "Authorization: Bearer sk-your-api-key" \
  -F file="@audio.mp3" \
  -F model="whisper-1" \
  -F language="en"
{
  "text": "Hello, this is a test of the transcription API."
}

リクエストボディ

file
file
必須
文字起こしする音声ファイル。サポートされている形式:flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm。
model
string
デフォルト:"whisper-1"
使用するモデル。現在は whisper-1 のみがサポートされています。
language
string
ISO-639-1 形式の音声の言語(例:en, zh, ja)。
prompt
string
モデルのスタイルをガイドしたり、前のセグメントを継続したりするためのオプションのテキスト。
response_format
string
デフォルト:"json"
出力形式:json, text, srt, verbose_json, vtt
temperature
number
デフォルト:"0"
サンプリング温度(0 から 1)。
timestamp_granularities
array
タイムスタンプの粒度:word または segment、あるいはその両方。verbose_json が必要です。

レスポンス

text
string
文字起こしされたテキスト。
verbose_json の場合:
task
string
常に transcribe
language
string
検出された言語。
duration
number
音声の長さ(秒)。
segments
array
タイムスタンプ付きの文字起こしセグメント。
words
array
単語レベルのタイムスタンプ(リクエストされた場合)。
curl -X POST "https://api.lemondata.cc/v1/audio/transcriptions" \
  -H "Authorization: Bearer sk-your-api-key" \
  -F file="@audio.mp3" \
  -F model="whisper-1" \
  -F language="en"
{
  "text": "Hello, this is a test of the transcription API."
}

翻訳

音声を英語に翻訳するには、translations エンドポイントを使用します:
response = client.audio.translations.create(
    model="whisper-1",
    file=audio_file
)