Skip to main content
POST
/
transcribe
/
status
cURL
curl --request POST \
  --url https://nano-gpt.com/api/transcribe/status \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "runId": "abc123def456",
  "cost": 123,
  "paymentSource": "<string>",
  "isApiRequest": true,
  "fileName": "<string>",
  "fileSize": 123,
  "chargedDuration": 123,
  "diarize": true
}
'
{
  "status": "pending",
  "transcription": "Speaker 1: Hello everyone. Speaker 2: Hi there!",
  "metadata": {
    "fileName": "<string>",
    "fileSize": 123,
    "chargedDuration": 123,
    "actualDuration": 123,
    "language": "<string>",
    "cost": 123,
    "currency": "<string>",
    "model": "<string>"
  },
  "words": [
    {
      "text": "<string>",
      "start": 123,
      "end": 123,
      "type": "word",
      "speaker_id": "<string>"
    }
  ],
  "diarization": {
    "segments": [
      {
        "speaker": "<string>",
        "text": "<string>",
        "start": 123,
        "end": 123
      }
    ]
  },
  "error": "<string>"
}

Overview

Check the status of an asynchronous transcription job (Elevenlabs-STT). Poll this endpoint to get transcription results when the job is completed.

Usage

This endpoint is used with the Elevenlabs-STT model which processes transcriptions asynchronously. After submitting a transcription job, you’ll receive a runId that you use to check the status.
import requests
import time

def check_transcription_status(run_id, job_data):
    headers = {
        "x-api-key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    }
    
    status_data = {
        "runId": run_id,
        "cost": job_data.get('cost'),
        "paymentSource": job_data.get('paymentSource'),
        "isApiRequest": True,
        "fileName": job_data.get('fileName'),
        "fileSize": job_data.get('fileSize'),
        "chargedDuration": job_data.get('chargedDuration'),
        "diarize": job_data.get('diarize', False)
    }
    
    response = requests.post(
        "https://nano-gpt.com/api/transcribe/status",
        headers=headers,
        json=status_data
    )
    
    return response.json()

def wait_for_completion(run_id, job_data, max_attempts=60):
    for attempt in range(max_attempts):
        result = check_transcription_status(run_id, job_data)
        status = result.get('status')
        
        if status == 'completed':
            return result
        elif status == 'failed':
            raise Exception(f"Transcription failed: {result.get('error')}")
        
        print(f"Status: {status} (attempt {attempt + 1}/{max_attempts})")
        time.sleep(5)
    
    raise Exception("Transcription timed out")

# Usage
job_data = {"runId": "abc123", "cost": 0.075, "paymentSource": "USD"}
result = wait_for_completion("abc123", job_data)
print(result['transcription'])

Status Values

  • pending: Job is queued for processing
  • processing: Transcription is in progress
  • completed: Transcription finished successfully
  • failed: Transcription failed (check error field)

Response Examples

Pending/Processing

{
  "status": "processing"
}

Completed

{
  "status": "completed",
  "transcription": "Speaker 1: Hello everyone. Speaker 2: Hi there!",
  "metadata": {
    "fileName": "meeting.mp3",
    "fileSize": 2345678,
    "chargedDuration": 2.5,
    "actualDuration": 2.47,
    "language": "en",
    "cost": 0.075,
    "currency": "USD",
    "model": "Elevenlabs-STT"
  },
  "words": [
    {
      "text": "Hello",
      "start": 0.5,
      "end": 0.9,
      "type": "word",
      "speaker_id": "speaker_0"
    }
  ],
  "diarization": {
    "segments": [
      {
        "speaker": "Speaker 1",
        "text": "Hello everyone",
        "start": 0.5,
        "end": 1.5
      }
    ]
  }
}

Failed

{
  "status": "failed",
  "error": "Audio file could not be processed"
}

Authorizations

x-api-key
string
header
required

Body

application/json

Status check parameters including runId from the initial transcription request

runId
string
required

Unique identifier for the transcription job

Example:

"abc123def456"

cost
number

Cost of the transcription (from initial response)

paymentSource
string

Payment source used (from initial response)

isApiRequest
boolean

Whether this is an API request (from initial response)

fileName
string

Original file name (from initial response)

fileSize
integer

File size in bytes (from initial response)

chargedDuration
number

Duration charged for billing (from initial response)

diarize
boolean

Whether speaker diarization is enabled (from initial response)

Response

Transcription status response

status
enum<string>
required

Current status of the transcription job

Available options:
pending,
processing,
completed,
failed
transcription
string

The transcribed text (available when status is 'completed')

Example:

"Speaker 1: Hello everyone. Speaker 2: Hi there!"

metadata
object

Transcription metadata (available when status is 'completed')

words
object[]

Word-level timestamps and speaker information (Elevenlabs-STT only)

diarization
object

Speaker diarization results (when enabled)

error
string

Error message (available when status is 'failed')