AyaSpeech Logo

Jobs (Async Transcription)

Audio files longer than 3 minutes are processed asynchronously. When you submit long audio to the transcription endpoint, you receive a job ID instead of an immediate result. Poll the job status endpoint to retrieve your transcript when processing completes.

How It Works

  1. Submit audio via POST /transcribe as usual.
  2. If the audio exceeds 3 minutes, the response returns a job_id with status queued.
  3. Poll GET /jobs/{job_id} until status is completed or failed.

Submission Response

When audio is queued for async processing, the transcribe endpoint returns:

{
  "job_id": "job_a1b2c3d4e5",
  "status": "queued",
  "audio_duration_seconds": 245.6,
  "message": "Audio exceeds 3 minutes. Processing asynchronously. Poll GET /jobs/{job_id} for results."
}

Poll Job Status

GET /jobs/{job_id}

Requires the same API token used to submit the audio. Returns the current job status.

Job Statuses

StatusDescription
queuedJob is waiting to be picked up by a worker
processingAudio is currently being transcribed
completedTranscription finished, result available
failedProcessing failed, error details available

Example

# 1. Submit long audio (returns job_id)
curl -X POST "https://api.ayaspeech.ayadata.ai/transcribe" \
  -H "x-api-token: your_api_token" \
  -F "audio_file=@long_recording.wav"

# 2. Poll for results
curl "https://api.ayaspeech.ayadata.ai/jobs/job_a1b2c3d4e5" \
  -H "x-api-token: your_api_token"

Completed Response

{
  "job_id": "job_a1b2c3d4e5",
  "status": "completed",
  "result": {
    "text": "Medaase paa, me din de Kwame. Me firi Kumasi...",
    "language": "twi",
    "inference_time_ms": 8542.3
  }
}

Failed Response

{
  "job_id": "job_a1b2c3d4e5",
  "status": "failed",
  "error": "Worker timeout: transcription exceeded maximum processing time."
}

Notes

  • The async threshold is 3 minutes of audio. Shorter files are transcribed synchronously.
  • Jobs expire after 24 hours, poll results before then.
  • Only the API token that submitted the job can poll its status.
  • Recommended polling interval: every 5–10 seconds.
  • Usage (minutes) is deducted at submission time, not when the job completes.