Transcribe Audio

Submit an audio file or URL for transcription.

Submit audio for asynchronous transcription.

Submit a job

Request

curl -X POST https://audio.lansonai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer sk-..." \
  -H "Content-Type: application/json" \
  -d '{
    "audio_url": "https://cdn.example.com/meeting.wav",
    "language": "zh",
    "prompt": "Medical cardiology conference",
    "webhook_url": "https://your-server.com/webhook"
  }'

Request body

FieldTypeRequiredDefaultDescription
audio_urlstringyesPublic audio URL, must be http(s)://
request_idstringnorandom UUIDIdempotency key; same ID resumes from R2 checkpoint
languagestringnoLanguage hint (e.g. zh, en)
modelstringnowhisper-large-v3-turboSTT model override
promptstringnoTranscription context hint
segment_secondsnumberno300Slice length in seconds, must be > 0
response_formatstringnoverbose_jsonResponse format
concurrencynumberno6Concurrent chunk transcription, must be > 0
webhook_urlstringnoPOST final result to this URL on completion
reviewbooleannofalseEnable two-stage LLM review
metadataobjectnoContext forwarded to review stages (e.g. medical_specialty, speaker_roles, known_medications)
response_format defaults to verbose_json in the OpenAPI schema, but the offline workflow currently hardcodes verbose_json for every chunk transcription. Setting this field has no effect today.

Response — 202 Accepted

{
  "request_id": "...",
  "workflow_id": "<uuid>",
  "status": "queued",
  "endpoint": "GET /<workflow_id>"
}

Poll for results

curl https://audio.lansonai.com/<workflow_id> \
  -H "Authorization: Bearer sk-..."

Status values

StatusMeaning
queuedWaiting to start
runningProcessing
completeDone (result in output)
erroredFailed (error in error)
terminatedTerminated

Complete output

{
  "status": "complete",
  "output": {
    "result": {
      "segments": [
        { "id": 0, "start_time": 0.0, "end_time": 3.2, "duration": 3.2, "text": "The weather is nice today", "confidence": 0.95 }
      ],
      "summary": {
        "total_duration": 120.5,
        "total_speech_duration": 95.3,
        "overall_speech_ratio": 0.79,
        "num_segments": 45
      },
      "metadata": {
        "language": "zh",
        "model": "whisper-large-v3-turbo",
        "chunk_count": 3,
        "audio_duration_seconds": 120.5
      }
    }
  }
}

Webhook

Set webhook_url to receive the final result via HTTP POST when the job completes. Eliminates the need for polling.

LLM review

Set review: true to enable two-stage LLM correction:

  1. Per-chunk review: each chunk is independently reviewed by an LLM
  2. Global review: after aggregation, a final correction pass

Suitable for high-accuracy scenarios (medical, legal). The metadata field passes context to the review stages.

R2 artifacts

Results are stored in R2 under transcription/{request_id}/:

ArtifactKey
Per-chunk transcriptionchunk_{i}.json
Raw aggregated transcriptresult.json
Per-chunk review annotationsreview_chunk_{i}.json (when review: true)
Final corrected transcriptreviewed_result.json (when review: true)

Idempotency

Provide request_id for idempotency:

  • Same request_id resumes from R2 checkpoint
  • Already-transcribed chunks are skipped
  • Avoids duplicate processing on retry