vercel/ai · error · AISDKError

TranscriptionJobFailed

TranscriptionJobFailed

Error message

Transcription job failed

What it means

Thrown when a polled Rev.ai transcription job reaches status 'failed'. The completed polling result (jobResponse) is attached as cause, containing Rev.ai's failure details. The job was accepted but failed during processing on Rev.ai's side.

Source

Thrown at packages/revai/src/revai-transcription-model.ts:203

      const pollingResult = await getFromApi({
        url: this.config.url({
          path: `/speechtotext/v1/jobs/${jobId}`,
          modelId: this.modelId,
        }),
        validateUrl: false,
        headers: combineHeaders(this.config.headers?.(), options.headers),
        failedResponseHandler: revaiFailedResponseHandler,
        successfulResponseHandler: createJsonResponseHandler(
          revaiTranscriptionJobResponseSchema,
        ),
        abortSignal: options.abortSignal,
        fetch: this.config.fetch,
      });

      jobResponse = pollingResult.value;

      if (jobResponse.status === 'failed') {
        throw new AISDKError({
          message: 'Transcription job failed',
          name: 'TranscriptionJobFailed',
          cause: jobResponse,
        });
      }

      // Wait before polling again (only if we need to continue polling)
      if (jobResponse.status !== 'transcribed') {
        await delay(pollingInterval);
      }
    }

    const {
      value: transcriptionResult,
      responseHeaders,
      rawValue: rawResponse,
    } = await getFromApi({
      url: this.config.url({

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Inspect error.cause (the failed job response) for Rev.ai's failure reason
  2. Validate the audio file is complete, decodable, and in a supported format
  3. Re-submit the transcription job (transient failures often succeed on retry)
  4. If persistent, contact Rev.ai support with the job id
Defensive patterns

Strategy: retry

Validate before calling

// validate media before submitting
const head = await fetch(mediaUrl, { method: 'HEAD' });
if (!head.ok || Number(head.headers.get('content-length') ?? 0) === 0) {
  throw new Error('Media file missing or empty');
}

Type guard

function isTranscriptionJobFailed(e) {
  return typeof e === 'object' && e !== null && e.name === 'TranscriptionJobFailed';
}

Try / catch

try {
  result = await model.doGenerate(options);
} catch (e) {
  if (e.name === 'TranscriptionJobFailed') {
    console.error('Job failed:', e.cause);
    result = await retryWithBackoff(() => model.doGenerate(options));
  } else throw e;
}

Prevention

When it happens

Trigger: During doGenerate's polling loop, jobResponse.status === 'failed' — e.g. corrupt audio, media deletion mid-job, or internal Rev.ai processing error.

Common situations: Uploading truncated/corrupt media files; audio codec Rev.ai cannot decode; transient Rev.ai processing failures.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/10e0a078b3cf762e. Report an issue: GitHub.