Skip to main content
POST
/
v2
/
transcription
Initiate a new transcription job
curl --request POST \
  --url https://api.gladia.io/v2/transcription \
  --header 'Content-Type: application/json' \
  --header 'x-gladia-key: <api-key>' \
  --data '
{
  "audio_url": "https://files.gladia.io/example/audio-transcription/split_infinity.wav",
  "custom_vocabulary": false,
  "callback_url": "https://callback.example",
  "callback": false,
  "subtitles": false,
  "subtitles_config": {
    "formats": [
      "srt"
    ],
    "minimum_duration": 1,
    "maximum_duration": 15.5,
    "maximum_characters_per_row": 2,
    "maximum_rows_per_caption": 3,
    "style": "default"
  },
  "diarization": false,
  "diarization_config": {
    "number_of_speakers": 3,
    "min_speakers": 1,
    "max_speakers": 2
  },
  "translation": false,
  "summarization": false,
  "summarization_config": {
    "type": "general"
  },
  "named_entity_recognition": false,
  "custom_spelling": false,
  "sentiment_analysis": false,
  "audio_to_llm": false,
  "pii_redaction": false,
  "pii_redaction_config": {
    "entity_types": [
      "GDPR",
      "HEALTH_INFORMATION",
      "HIPAA_SAFE_HARBOR",
      "QUEBEC_PRIVACY_ACT",
      "EMAIL_ADDRESS",
      "NAME",
      "PHONE_NUMBER"
    ],
    "processed_text_type": "MARKER"
  },
  "custom_metadata": {
    "user": "John Doe"
  },
  "sentences": false,
  "punctuation_enhanced": false,
  "language_config": {
    "languages": [],
    "code_switching": false
  }
}
'
import requests

url = "https://api.gladia.io/v2/transcription"

payload = {
"audio_url": "https://files.gladia.io/example/audio-transcription/split_infinity.wav",
"custom_vocabulary": False,
"callback_url": "https://callback.example",
"callback": False,
"subtitles": False,
"subtitles_config": {
"formats": ["srt"],
"minimum_duration": 1,
"maximum_duration": 15.5,
"maximum_characters_per_row": 2,
"maximum_rows_per_caption": 3,
"style": "default"
},
"diarization": False,
"diarization_config": {
"number_of_speakers": 3,
"min_speakers": 1,
"max_speakers": 2
},
"translation": False,
"summarization": False,
"summarization_config": { "type": "general" },
"named_entity_recognition": False,
"custom_spelling": False,
"sentiment_analysis": False,
"audio_to_llm": False,
"pii_redaction": False,
"pii_redaction_config": {
"entity_types": ["GDPR", "HEALTH_INFORMATION", "HIPAA_SAFE_HARBOR", "QUEBEC_PRIVACY_ACT", "EMAIL_ADDRESS", "NAME", "PHONE_NUMBER"],
"processed_text_type": "MARKER"
},
"custom_metadata": { "user": "John Doe" },
"sentences": False,
"punctuation_enhanced": False,
"language_config": {
"languages": [],
"code_switching": False
}
}
headers = {
"x-gladia-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-gladia-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
audio_url: 'https://files.gladia.io/example/audio-transcription/split_infinity.wav',
custom_vocabulary: false,
callback_url: 'https://callback.example',
callback: false,
subtitles: false,
subtitles_config: {
formats: ['srt'],
minimum_duration: 1,
maximum_duration: 15.5,
maximum_characters_per_row: 2,
maximum_rows_per_caption: 3,
style: 'default'
},
diarization: false,
diarization_config: {number_of_speakers: 3, min_speakers: 1, max_speakers: 2},
translation: false,
summarization: false,
summarization_config: {type: 'general'},
named_entity_recognition: false,
custom_spelling: false,
sentiment_analysis: false,
audio_to_llm: false,
pii_redaction: false,
pii_redaction_config: {
entity_types: [
'GDPR',
'HEALTH_INFORMATION',
'HIPAA_SAFE_HARBOR',
'QUEBEC_PRIVACY_ACT',
'EMAIL_ADDRESS',
'NAME',
'PHONE_NUMBER'
],
processed_text_type: 'MARKER'
},
custom_metadata: {user: 'John Doe'},
sentences: false,
punctuation_enhanced: false,
language_config: {languages: [], code_switching: false}
})
};

fetch('https://api.gladia.io/v2/transcription', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gladia.io/v2/transcription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'audio_url' => 'https://files.gladia.io/example/audio-transcription/split_infinity.wav',
'custom_vocabulary' => false,
'callback_url' => 'https://callback.example',
'callback' => false,
'subtitles' => false,
'subtitles_config' => [
'formats' => [
'srt'
],
'minimum_duration' => 1,
'maximum_duration' => 15.5,
'maximum_characters_per_row' => 2,
'maximum_rows_per_caption' => 3,
'style' => 'default'
],
'diarization' => false,
'diarization_config' => [
'number_of_speakers' => 3,
'min_speakers' => 1,
'max_speakers' => 2
],
'translation' => false,
'summarization' => false,
'summarization_config' => [
'type' => 'general'
],
'named_entity_recognition' => false,
'custom_spelling' => false,
'sentiment_analysis' => false,
'audio_to_llm' => false,
'pii_redaction' => false,
'pii_redaction_config' => [
'entity_types' => [
'GDPR',
'HEALTH_INFORMATION',
'HIPAA_SAFE_HARBOR',
'QUEBEC_PRIVACY_ACT',
'EMAIL_ADDRESS',
'NAME',
'PHONE_NUMBER'
],
'processed_text_type' => 'MARKER'
],
'custom_metadata' => [
'user' => 'John Doe'
],
'sentences' => false,
'punctuation_enhanced' => false,
'language_config' => [
'languages' => [

],
'code_switching' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-gladia-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.gladia.io/v2/transcription"

payload := strings.NewReader("{\n \"audio_url\": \"https://files.gladia.io/example/audio-transcription/split_infinity.wav\",\n \"custom_vocabulary\": false,\n \"callback_url\": \"https://callback.example\",\n \"callback\": false,\n \"subtitles\": false,\n \"subtitles_config\": {\n \"formats\": [\n \"srt\"\n ],\n \"minimum_duration\": 1,\n \"maximum_duration\": 15.5,\n \"maximum_characters_per_row\": 2,\n \"maximum_rows_per_caption\": 3,\n \"style\": \"default\"\n },\n \"diarization\": false,\n \"diarization_config\": {\n \"number_of_speakers\": 3,\n \"min_speakers\": 1,\n \"max_speakers\": 2\n },\n \"translation\": false,\n \"summarization\": false,\n \"summarization_config\": {\n \"type\": \"general\"\n },\n \"named_entity_recognition\": false,\n \"custom_spelling\": false,\n \"sentiment_analysis\": false,\n \"audio_to_llm\": false,\n \"pii_redaction\": false,\n \"pii_redaction_config\": {\n \"entity_types\": [\n \"GDPR\",\n \"HEALTH_INFORMATION\",\n \"HIPAA_SAFE_HARBOR\",\n \"QUEBEC_PRIVACY_ACT\",\n \"EMAIL_ADDRESS\",\n \"NAME\",\n \"PHONE_NUMBER\"\n ],\n \"processed_text_type\": \"MARKER\"\n },\n \"custom_metadata\": {\n \"user\": \"John Doe\"\n },\n \"sentences\": false,\n \"punctuation_enhanced\": false,\n \"language_config\": {\n \"languages\": [],\n \"code_switching\": false\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-gladia-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.gladia.io/v2/transcription")
.header("x-gladia-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"audio_url\": \"https://files.gladia.io/example/audio-transcription/split_infinity.wav\",\n \"custom_vocabulary\": false,\n \"callback_url\": \"https://callback.example\",\n \"callback\": false,\n \"subtitles\": false,\n \"subtitles_config\": {\n \"formats\": [\n \"srt\"\n ],\n \"minimum_duration\": 1,\n \"maximum_duration\": 15.5,\n \"maximum_characters_per_row\": 2,\n \"maximum_rows_per_caption\": 3,\n \"style\": \"default\"\n },\n \"diarization\": false,\n \"diarization_config\": {\n \"number_of_speakers\": 3,\n \"min_speakers\": 1,\n \"max_speakers\": 2\n },\n \"translation\": false,\n \"summarization\": false,\n \"summarization_config\": {\n \"type\": \"general\"\n },\n \"named_entity_recognition\": false,\n \"custom_spelling\": false,\n \"sentiment_analysis\": false,\n \"audio_to_llm\": false,\n \"pii_redaction\": false,\n \"pii_redaction_config\": {\n \"entity_types\": [\n \"GDPR\",\n \"HEALTH_INFORMATION\",\n \"HIPAA_SAFE_HARBOR\",\n \"QUEBEC_PRIVACY_ACT\",\n \"EMAIL_ADDRESS\",\n \"NAME\",\n \"PHONE_NUMBER\"\n ],\n \"processed_text_type\": \"MARKER\"\n },\n \"custom_metadata\": {\n \"user\": \"John Doe\"\n },\n \"sentences\": false,\n \"punctuation_enhanced\": false,\n \"language_config\": {\n \"languages\": [],\n \"code_switching\": false\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.gladia.io/v2/transcription")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-gladia-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"audio_url\": \"https://files.gladia.io/example/audio-transcription/split_infinity.wav\",\n \"custom_vocabulary\": false,\n \"callback_url\": \"https://callback.example\",\n \"callback\": false,\n \"subtitles\": false,\n \"subtitles_config\": {\n \"formats\": [\n \"srt\"\n ],\n \"minimum_duration\": 1,\n \"maximum_duration\": 15.5,\n \"maximum_characters_per_row\": 2,\n \"maximum_rows_per_caption\": 3,\n \"style\": \"default\"\n },\n \"diarization\": false,\n \"diarization_config\": {\n \"number_of_speakers\": 3,\n \"min_speakers\": 1,\n \"max_speakers\": 2\n },\n \"translation\": false,\n \"summarization\": false,\n \"summarization_config\": {\n \"type\": \"general\"\n },\n \"named_entity_recognition\": false,\n \"custom_spelling\": false,\n \"sentiment_analysis\": false,\n \"audio_to_llm\": false,\n \"pii_redaction\": false,\n \"pii_redaction_config\": {\n \"entity_types\": [\n \"GDPR\",\n \"HEALTH_INFORMATION\",\n \"HIPAA_SAFE_HARBOR\",\n \"QUEBEC_PRIVACY_ACT\",\n \"EMAIL_ADDRESS\",\n \"NAME\",\n \"PHONE_NUMBER\"\n ],\n \"processed_text_type\": \"MARKER\"\n },\n \"custom_metadata\": {\n \"user\": \"John Doe\"\n },\n \"sentences\": false,\n \"punctuation_enhanced\": false,\n \"language_config\": {\n \"languages\": [],\n \"code_switching\": false\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "45463597-20b7-4af7-b3b3-f5fb778203ab",
  "result_url": "https://api.gladia.io/v2/transcription/45463597-20b7-4af7-b3b3-f5fb778203ab"
}
{
"timestamp": "2023-12-28T09:04:17.210Z",
"path": "/v2/transcription/45463597-20b7-4af7-b3b3-f5fb778203ab",
"request_id": "G-821fe9df",
"statusCode": 400,
"message": "Content-Type is missing Multipart Boundary.",
"validation_errors": [
"Field \"language\" must be a string",
"Field \"min_speakers\" must be a number"
]
}
{
"timestamp": "2023-12-28T09:04:17.210Z",
"path": "/v2/transcription/45463597-20b7-4af7-b3b3-f5fb778203ab",
"request_id": "G-821fe9df",
"statusCode": 401,
"message": "gladia key not found"
}
{
"timestamp": "2023-12-28T09:04:17.210Z",
"path": "/v2/transcription/45463597-20b7-4af7-b3b3-f5fb778203ab",
"request_id": "G-821fe9df",
"statusCode": 422,
"message": "Invalid parameter"
}

Authorizations

x-gladia-key
string
header
required

Your personal Gladia API key

Body

application/json
audio_url
string<uri>
required

URL to a Gladia file or to an external audio or video file

Example:

"https://files.gladia.io/example/audio-transcription/split_infinity.wav"

custom_vocabulary
boolean
default:false

[Beta] Can be either boolean to enable custom_vocabulary for this audio or an array with specific vocabulary list to feed the transcription model with

custom_vocabulary_config
object

[Beta] Custom vocabulary configuration, if custom_vocabulary is enabled

callback_url
string<uri>
deprecated

[Deprecated] Use callback/callback_config instead. Callback URL we will do a POST request to with the result of the transcription

Example:

"https://callback.example"

callback
boolean
default:false

Enable callback for this transcription. If true, the callback_config property will be used to customize the callback behaviour

callback_config
object

Customize the callback behaviour (url and http method)

subtitles
boolean
default:false

Enable subtitles generation for this transcription

subtitles_config
object

Configuration for subtitles generation if subtitles is enabled

diarization
boolean
default:false

Enable speaker recognition (diarization) for this audio

diarization_config
object

Speaker recognition configuration, if diarization is enabled

translation
boolean
default:false

[Beta] Enable translation for this audio

translation_config
object

[Beta] Translation configuration, if translation is enabled

summarization
boolean
default:false

Enable summarization for this audio

summarization_config
object

Summarization configuration, if summarization is enabled

named_entity_recognition
boolean
default:false

[Alpha] Enable named entity recognition for this audio

custom_spelling
boolean
default:false

[Alpha] Enable custom spelling for this audio

custom_spelling_config
object

[Alpha] Custom spelling configuration, if custom_spelling is enabled

sentiment_analysis
boolean
default:false

Enable sentiment analysis for this audio

audio_to_llm
boolean
default:false

Enable audio to LLM processing for this audio

audio_to_llm_config
object

Audio to LLM configuration, if audio_to_llm is enabled

pii_redaction
boolean
default:false

Enable PII redaction for this audio

pii_redaction_config
object

PII redaction configuration, if pii_redaction is enabled

custom_metadata
object

Custom metadata you can attach to this transcription

Example:
{ "user": "John Doe" }
sentences
boolean
default:false

Enable sentences for this audio

punctuation_enhanced
boolean
default:false

[Alpha] Use enhanced punctuation for this audio

language_config
object

Specify the language configuration

Response

The transcription job has been initiated

id
string<uuid>
required

Id of the job

Example:

"45463597-20b7-4af7-b3b3-f5fb778203ab"

result_url
string<uri>
required

Prebuilt URL with your transcription id to fetch the result

Example:

"https://api.gladia.io/v2/transcription/45463597-20b7-4af7-b3b3-f5fb778203ab"