Skip to content

Create a transcription task

POSThttps://gptunnel.ru/v1/audio/transcriptions

Transcription runs asynchronously. The endpoint creates a task and returns its id and status. Set callback_url to receive the result via webhook, or poll the result endpoint.

Request headers

ParameterTypeRequired?Description
AuthorizationstringRequiredAPI key

Request body

ParameterTypeRequired?Description
audio_urlstringRequiredDirect public HTTP or HTTPS URL for the audio or video file
modelstringRequiredModel: deepgram-whisper-tiny | deepgram-whisper-medium | deepgram-whisper-large
languagestringOptionalLanguage code (e.g. "ru", "en"). If not specified, language is automatically defined
callback_urlstringOptionalURL to send the result (webhook). Must be public

Set your API key in the GPTUNNEL_API_KEY environment variable. The Python example uses requests and the cURL example uses jq. Save the task ID printed by the example and pass it as task_id when you retrieve the transcription. All three examples use the sample WAV file from the quickstart. To transcribe a different file, set GPTUNNEL_AUDIO_URL to its public HTTPS URL.

import os
import requests
response = requests.post(
'https://gptunnel.ru/v1/audio/transcriptions',
headers={'Authorization': os.environ['GPTUNNEL_API_KEY']},
json={
'audio_url': os.environ.get('GPTUNNEL_AUDIO_URL') or 'https://docs.gptunnel.ru/examples/blue-sky.wav',
'model': 'deepgram-whisper-tiny',
'language': 'en',
},
timeout=30,
)
response.raise_for_status()
print(response.json()['id'])
{
"code": 0,
"id": "6a47bb78fb3f0d852e64c8e3",
"status": "processing"
}

Errors that arise after the creation of a task are listed in transcription errors.