### Speech Start Event Example Source: https://docs.gladia.io/api-reference/v2/live/websocket This example shows the JSON payload for a 'speech_start' event, indicating the beginning of detected speech activity. It includes a session ID, timestamp, event type, and timing data. ```json { "session_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2025-09-19T12:34:06Z", "type": "speech_start", "data": { "time": 1.24, "channel": 0 } } ``` -------------------------------- ### Post Chapterization Message Example Source: https://docs.gladia.io/api-reference/v2/live/websocket This example shows the structure of a message containing chapterization results for an audio chunk. It includes session ID, creation timestamp, and detailed results with headlines, start/end times, and keywords. ```json { "session_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2025-09-19T12:46:00Z", "type": "post_chapterization", "error": null, "data": { "results": [ { "headline": "Project kickoff", "start": 0, "end": 60, "keywords": [ "timeline", "owner" ] } ] } } ``` -------------------------------- ### Post Summarization Message Example Source: https://docs.gladia.io/api-reference/v2/live/websocket This example demonstrates the format of a message containing a post-processing summarization of an audio chunk. It includes session ID, creation timestamp, and the summarized text. ```json { "session_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2025-09-19T12:47:00Z", "type": "post_summarization", "error": null, "data": { "results": "The team aligned on goals and next steps for the quarter." } } ``` -------------------------------- ### Start Recording Event Source: https://docs.gladia.io/api-reference/v2/live/websocket This message is emitted when audio capture or streaming begins for a session. ```APIDOC ## Start Recording ### Description This message contains the informations about the start recording of the audio chunk. ### Method SEND ### Endpoint N/A (WebSocket Event) ### Payload Schema ```json { "session_id": "string", "created_at": "string", "type": "start_recording" } ``` ### Parameters #### Payload Fields - **session_id** (string) - Required - UUID identifying the session. - **created_at** (string) - Required - ISO 8601 timestamp in UTC. - **type** (string) - Required - Lifecycle event emitted when audio capture/streaming begins. Must be 'start_recording'. ### Request Example ```json { "session_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2025-09-19T12:34:05Z", "type": "start_recording" } ``` ``` -------------------------------- ### Start Session Source: https://docs.gladia.io/api-reference/v2/live/websocket Initiates a new audio processing session. This event is emitted once when the session is created and ready. ```APIDOC ## Start Session ### Description Initiates a new audio processing session. This event is emitted once when the session is created and ready. ### Method SEND ### Endpoint N/A (WebSocket Message) ### Payload #### Properties - **session_id** (string) - Required - UUID identifying the session. - **created_at** (string) - Required - ISO 8601 timestamp in UTC. - **type** (string) - Required - Lifecycle event emitted once when the session is created and ready. Must be 'start_session'. ### Request Example ```json { "session_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2025-09-19T12:34:00Z", "type": "start_session" } ``` ``` -------------------------------- ### On Speech Start Event Source: https://docs.gladia.io/api-reference/v2/live/websocket This event is sent when speech activity is detected on a channel. It includes session details and timing information. ```APIDOC ## On Speech Start Event ### Description Indicates the start of detected speech activity on a given channel. ### Message Type `send` ### Event Payload (JSON) ```json { "session_id": "string", "created_at": "string", "type": "speech_start", "data": { "time": "number", "channel": "integer" } } ``` ### Parameters #### Request Body - **session_id** (string) - Required - UUID identifying the session. - **created_at** (string) - Required - ISO 8601 timestamp in UTC. - **type** (string) - Required - Must be `speech_start`. - **data** (object) - Required - Timing information for speech start/end events. - **time** (number) - Optional - Time in seconds from session start when the event occurred. - **channel** (integer) - Optional - Audio channel index (0-based) for which the event applies. ### Example ```json { "session_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2025-09-19T12:34:06Z", "type": "speech_start", "data": { "time": 1.24, "channel": 0 } } ``` ``` -------------------------------- ### POST /v2/live Source: https://docs.gladia.io/api-reference/v2/live/init Initiates a new live audio processing job. This endpoint allows you to start a real-time transcription session by providing details about the audio stream and processing preferences. ```APIDOC ## POST /v2/live ### Description Initiates a new live job for audio processing. ### Method POST ### Endpoint https://api.gladia.io/v2/live ### Parameters #### Query Parameters - **region** (string) - Optional - The region used to process the audio. Supported values: `us-west`, `eu-west`. #### Request Body - **encoding** (string) - Optional - The encoding format of the audio stream. Supported formats: PCM (8, 16, 24, 32 bits), A-law (8 bits), μ-law (8 bits). Default: `wav/pcm`. - **bit_depth** (integer) - Optional - The bit depth of the audio stream. Default: `16`. - **sample_rate** (integer) - Optional - The sample rate of the audio stream. Default: `16000`. - **channels** (integer) - Optional - The number of channels of the audio stream. Minimum: `1`, Maximum: `8`. Default: `1`. - **custom_metadata** (object) - Optional - Custom metadata you can attach to this live transcription. - **model** (string) - Optional - The model used to process the audio. Default: `solaria-1`. - **endpointing** (number) - Optional - The endpointing duration in seconds. Default: `0.05`. - **maximum_duration_without_endpointing** (number) - Optional - The maximum duration in seconds without endpointing. Default: `5`. - **language_config** (object) - Optional - Specify the language configuration. - **pre_processing** (object) - Optional - Specify the pre-processing configuration. - **realtime_processing** (object) - Optional - Specify the realtime processing configuration. - **post_processing** (object) - Optional - Specify the post-processing configuration. - **messages_config** (object) - Optional - Specify the websocket messages configuration. - **callback** (boolean) - Optional - If true, messages will be sent to configured url. Default: `false`. ### Request Example ```json { "encoding": "wav/pcm", "sample_rate": 16000, "channels": 1, "custom_metadata": { "user": "John Doe" }, "model": "solaria-1", "endpointing": 0.05, "maximum_duration_without_endpointing": 5, "language_config": {}, "pre_processing": {}, "realtime_processing": {}, "post_processing": {}, "messages_config": {}, "callback": false } ``` ### Response #### Success Response (201) - **id** (string) - The unique identifier for the live job. - **status** (string) - The status of the live job. #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "status": "initiated" } ``` #### Error Responses - **400** - Bad Request: Something is wrong with the request. - **401** - Unauthorized: You don't have the permissions to initiate a new live job. - **422** - Unprocessable Entity: The parameters you gave are incorrect. ``` -------------------------------- ### Get Pre-recorded Jobs Source: https://docs.gladia.io/api-reference/v2/pre-recorded/list Fetches a list of pre-recorded jobs based on specified query parameters. Supports filtering by date, status, and custom metadata, as well as pagination. ```APIDOC ## GET /v2/pre-recorded ### Description Get pre recorded jobs based on query parameters. ### Method GET ### Endpoint /v2/pre-recorded ### Parameters #### Query Parameters - **offset** (integer) - Optional - The starting point for pagination. A value of 0 starts from the first item. Defaults to 0. - **limit** (integer) - Optional - The maximum number of items to return. Useful for pagination and controlling data payload size. Defaults to 20. - **date** (string) - Optional - Filter items relevant to a specific date in ISO format (YYYY-MM-DD). - **before_date** (string) - Optional - Include items that occurred before the specified date in ISO format. - **after_date** (string) - Optional - Filter for items after the specified date. Use with `before_date` for a range. Date in ISO format. - **status** (array of strings) - Optional - Filter the list based on item status. Accepts multiple values from the predefined list (queued, processing, done, error). - **custom_metadata** (object) - Optional - Filter by custom metadata. ### Responses #### Success Response (200) - **first** (string) - URL to fetch the first page. - **current** (string) - URL to fetch the current page. - **next** (string) - URL to fetch the next page. - **items** (array) - List of pre-recorded transcriptions. #### Error Response (401) - **timestamp** (string) - Date of when the error occurred. - **path** (string) - Path to the API endpoint. - **request_id** (string) - Debug id. - **statusCode** (number) - HTTP status code of the error. - **message** (string) - Error message. ### Security - x_gladia_key ``` -------------------------------- ### Transcription Result Example Source: https://docs.gladia.io/api-reference/v2/live/websocket This example demonstrates the structure of a transcription result message. It contains word-level details including text, start and end times, and confidence scores, along with the overall transcribed text and detected language. ```json { "session_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2025-09-19T12:34:06Z", "type": "transcript", "data": { "words": [ { "word": "Hello", "start": 0.24, "end": 0.36, "confidence": 0.91 }, { "word": "world", "start": 0.36, "end": 0.48, "confidence": 0.91 } ], "text": "Hello world.", "language": "en" } } ``` -------------------------------- ### Initiate Pre-recorded Transcription Source: https://docs.gladia.io/api-reference/v2/transcription/init Initiates a pre-recorded transcription job. Use the returned ID with the GET /v2/transcription/:id endpoint to get the results. ```APIDOC ## POST /v2/transcription/init ### Description Initiates a pre-recorded transcription job. Use the returned ID with the GET /v2/transcription/:id endpoint to obtain the results. ### Method POST ### Endpoint /v2/transcription/init ### Parameters #### Request Body - **audio_url** (string) - Required - The URL of the audio file to transcribe. - **webhook_url** (string) - Optional - The URL to send the transcription results to. - **language** (string) - Optional - The language of the audio file (e.g., 'en', 'es', 'fr'). ### Request Example ```json { "audio_url": "https://example.com/audio.mp3", "webhook_url": "https://example.com/webhook", "language": "en" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the transcription job. #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ``` ``` -------------------------------- ### Get Transcription by ID Source: https://docs.gladia.io/api-reference/v2/transcription/get Fetches the transcription details for a specific transcription ID. ```APIDOC ## GET /v2/transcription/{transcription_id} ### Description Retrieves the transcription details for a given transcription ID. ### Method GET ### Endpoint /v2/transcription/{transcription_id} ### Parameters #### Path Parameters - **transcription_id** (string) - Required - The unique identifier of the transcription job. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the transcription. - **filename** (string) - The name of the uploaded file. - **source** (string) - The link to download the file if an audio URL was used. - **audio_duration** (number) - The duration of the audio file in seconds. - **number_of_channels** (integer) - The number of channels in the audio file. #### Response Example ```json { "id": "45463597-20b7-4af7-b3b3-f5fb778203ab", "filename": "audio.mp3", "source": "http://example.com/audio.mp3", "audio_duration": 120.5, "number_of_channels": 2 } ``` ``` -------------------------------- ### Audio to LLM Prompt Configuration Source: https://docs.gladia.io/api-reference/v2/pre-recorded/list Configure prompts and models for processing audio transcriptions with Large Language Models. ```APIDOC ## Audio to LLM Prompt Configuration ### Description Configure prompts and models for processing audio transcriptions with Large Language Models. ### Parameters #### Request Body - **prompts** (array) - Required - The list of prompts applied on the audio transcription. Example: `["Extract the key points from the transcription"]`. - **model** (string) - Optional - The model to use for the prompt execution. You can find the list of supported models [here](https://openrouter.ai/models). Defaults to 'openai/gpt-3.5-turbo'. ``` -------------------------------- ### Authenticate API Calls with API Key Source: https://docs.gladia.io/api-reference/authentication Use your API key in the 'x-gladia-key' header to authenticate all API requests. This method is universally applicable across all environments. ```bash curl --request GET \ --url https://api.gladia.io/v2/transcription \ --header 'x-gladia-key: YOUR_GLADIA_API_KEY' ``` -------------------------------- ### Get Transcription Status and Results Source: https://docs.gladia.io/api-reference/v2/transcription/get Retrieve the status and results of a transcription job by its ID. ```APIDOC ## GET /v2/transcription/{transcriptionId} ### Description Retrieves the status and results of a transcription job. ### Method GET ### Endpoint /v2/transcription/{transcriptionId} ### Parameters #### Path Parameters - **transcriptionId** (string) - Required - The ID of the transcription job to retrieve. ### Response #### Success Response (200) - **id** (string) - Id of the job - **request_id** (string) - Debug id - **version** (integer) - API version - **status** (string) - Status of the job (queued, processing, done, error) - **created_at** (string) - Creation date - **completed_at** (string) - Completion date when status is "done" or "error" - **custom_metadata** (object) - Custom metadata given in the initial request - **error_code** (integer) - HTTP status code of the error if status is "error" - **post_session_metadata** (object) - For debugging purposes, send data that could help to identify issues - **kind** (string) - Type of transcription (pre-recorded or live) - **file** (object) - The file data uploaded. Can be null if status is "error" - **request_params** (object) - Parameters used for the transcription - **result** (object) - Transcription's result when status is "done" #### Response Example (Pre-recorded) { "id": "45463597-20b7-4af7-b3b3-f5fb778203ab", "request_id": "G-45463597", "version": 2, "status": "done", "created_at": "2023-12-28T09:04:17.210Z", "completed_at": "2023-12-28T09:04:37.210Z", "custom_metadata": { "user": "John Doe" }, "error_code": null, "post_session_metadata": {}, "kind": "pre-recorded", "file": { "content_type": "audio/mpeg", "size": 1024000, "last_modified": "2023-12-28T09:04:17.210Z" }, "request_params": { "language": "en" }, "result": { "transcription": [ { "alternatives": [ { "content": "Hello world.", "confidence": 0.98 } ], "start_time": 0.5, "end_time": 1.5 } ], "language": "en", "language_is_accurate": true } } #### Response Example (Live) { "id": "45463597-20b7-4af7-b3b3-f5fb778203ab", "request_id": "G-45463597", "version": 2, "status": "done", "created_at": "2023-12-28T09:04:17.210Z", "completed_at": "2023-12-28T09:04:37.210Z", "custom_metadata": { "user": "John Doe" }, "error_code": null, "post_session_metadata": {}, "kind": "live", "file": null, "request_params": { "language": "en" }, "result": { "messages": [ { "content": "Hello world.", "start_time": 0.5, "end_time": 1.5, "speaker": 0 } ], "language": "en", "language_is_accurate": true } } #### Error Response (401) { "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" } ``` -------------------------------- ### Download Live Audio File (OpenAPI) Source: https://docs.gladia.io/api-reference/v2/live/get-audio Use this OpenAPI definition to understand the request and response structure for downloading live audio. Ensure you include your API key in the request headers. ```yaml GET /v2/live/{id}/file openapi: 3.1.0 info: title: Gladia Control API description: '' version: '1.0' contact: {} servers: - url: https://api.gladia.io/ description: Gladia API production URL security: [] tags: [] paths: /v2/live/{id}/file: get: tags: - Live V2 summary: Download the audio file used for this live job operationId: StreamingController_getAudio_v2 parameters: - name: id required: true in: path description: Id of the live job schema: example: 45463597-20b7-4af7-b3b3-f5fb778203ab type: string responses: '200': description: The audio file used for this live job content: application/octet-stream: schema: type: string format: binary example: '401': description: >- You don't have the permissions to access this live job or its audio file content: application/json: schema: $ref: '#/components/schemas/UnauthorizedErrorResponse' '404': description: The live job or its audio file doesn't exist or has been deleted content: application/json: schema: $ref: '#/components/schemas/NotFoundErrorResponse' security: - x_gladia_key: [] components: schemas: UnauthorizedErrorResponse: type: object properties: timestamp: type: string description: Date of when the error occurred example: '2023-12-28T09:04:17.210Z' path: type: string description: Path to the API endpoint example: /v2/transcription/45463597-20b7-4af7-b3b3-f5fb778203ab request_id: type: string description: Debug id example: G-821fe9df statusCode: type: number description: HTTP status code of the error example: 401 message: type: string description: Error message example: gladia key not found required: - timestamp - path - request_id - statusCode - message NotFoundErrorResponse: type: object properties: timestamp: type: string description: Date of when the error occurred example: '2023-12-28T09:04:17.210Z' path: type: string description: Path to the API endpoint example: /v2/transcription/45463597-20b7-4af7-b3b3-f5fb778203ab request_id: type: string description: Debug id example: G-821fe9df statusCode: type: number description: HTTP status code of the error example: 404 message: type: string description: Error message example: Not found required: - timestamp - path - request_id - statusCode - message securitySchemes: x_gladia_key: type: apiKey in: header name: x-gladia-key description: Your personal Gladia API key ``` -------------------------------- ### Callback Configuration Source: https://docs.gladia.io/api-reference/v2/pre-recorded/init Set up a callback URL to receive transcription results for pre-recorded audio. ```APIDOC ## CallbackConfigDto ### Description Configuration for callback notifications. ### Properties - **url** (string) - Required - The URL to be called with the result of the transcription. - Example: http://callback.example - **method** (string) - Optional - The HTTP method to be used. Allowed values are `POST` or `PUT`. Defaults to `POST`. - Example: POST ``` -------------------------------- ### Get Transcription Job by ID Source: https://docs.gladia.io/api-reference/v2/transcription/get Fetches the metadata for a transcription job using its unique identifier. ```APIDOC ## GET /v2/transcription/{id} ### Description Retrieves the metadata for a specific transcription job. ### Method GET ### Endpoint /v2/transcription/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Id of the transcription job ### Responses #### Success Response (200) - **id** (string) - Id of the job - **request_id** (string) - Debug id - **version** (integer) - API version - **kind** (string) - Type of transcription job (e.g., pre-recorded, live) - **created_at** (string) - Creation date - **status** (string) - Status of the job (queued, processing, done, error) - **file** (object) - Details about the audio file - **id** (string) - File ID - **filename** (string) - Original filename - **source** (string) - URL of the audio source - **audio_duration** (integer) - Duration of the audio in seconds - **number_of_channels** (integer) - Number of audio channels - **request_params** (object) - Parameters used for the transcription request - **audio_url** (string) - URL of the audio file - **subtitles** (boolean) - Whether subtitles were requested - **diarization** (boolean) - Whether diarization was enabled - **translation** (boolean) - Whether translation was requested - **summarization** (boolean) - Whether summarization was requested - **sentences** (boolean) - Whether sentence segmentation was requested - **moderation** (boolean) - Whether content moderation was enabled - **named_entity_recognition** (boolean) - Whether Named Entity Recognition was enabled - **name_consistency** (boolean) - Whether name consistency was enforced - **custom_spelling** (boolean) - Whether custom spelling was used - **structured_data_extraction** (boolean) - Whether structured data extraction was enabled - **chapterization** (boolean) - Whether chapterization was enabled - **sentiment_analysis** (boolean) - Whether sentiment analysis was enabled - **display_mode** (boolean) - Display mode setting - **audio_enhancer** (boolean) - Whether audio enhancement was used - **language_config** (object) - Language configuration - **code_switching** (boolean) - Whether code switching is enabled - **languages** (array) - List of languages detected or specified - **accurate_words_timestamps** (boolean) - Whether accurate word timestamps were generated - **diarization_enhanced** (boolean) - Whether enhanced diarization was used - **punctuation_enhanced** (boolean) - Whether enhanced punctuation was used - **completed_at** (string) - Completion date (null if not completed) - **custom_metadata** (object) - Custom metadata provided in the request (null if none) - **error_code** (string) - Error code if the job failed (null if successful) - **result** (object) - The transcription result (null if not available) #### Error Response (401) - Description: You don't have the permissions to access the transcription job. #### Error Response (404) - Description: The transcription job doesn't exist or has been deleted. ### Request Example ```json { "example": "" } ``` ### Response Example ```json { "id": "45463597-20b7-4af7-b3b3-f5fb778203ab", "request_id": "G-45463597", "version": 2, "kind": "pre-recorded", "created_at": "2023-12-28T09:04:17.210Z", "status": "queued", "file": { "id": "f0dcZE10-23d8-47f0-a25d-74a6eed88721", "filename": "split_infinity.wav", "source": "http://files.gladia.io/example/audio-transcription/split_infinity.wav", "audio_duration": 20, "number_of_channels": 1 }, "request_params": { "audio_url": "http://files.gladia.io/example/audio-transcription/split_infinity.wav", "subtitles": false, "diarization": false, "translation": false, "summarization": false, "sentences": false, "moderation": false, "named_entity_recognition": false, "name_consistency": false, "custom_spelling": false, "structured_data_extraction": false, "chapterization": false, "sentiment_analysis": false, "display_mode": false, "audio_enhancer": false, "language_config": { "code_switching": false, "languages": [ "fr", "en" ] }, "accurate_words_timestamps": false, "diarization_enhanced": false, "punctuation_enhanced": false }, "completed_at": null, "custom_metadata": null, "error_code": null, "result": null } ``` ``` -------------------------------- ### Get Pre-recorded Job by ID Source: https://docs.gladia.io/api-reference/v2/pre-recorded/get Fetches the metadata for a pre-recorded job using its unique identifier. ```APIDOC ## GET /v2/pre-recorded/{id} ### Description Retrieves the metadata for a pre-recorded job. ### Method GET ### Endpoint /v2/pre-recorded/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Id of the pre recorded job ### Responses #### Success Response (200) - **PreRecordedResponse** - The pre recorded job's metadata #### Error Responses - **401** - UnauthorizedErrorResponse: You don't have the permissions to access the pre recorded job. - **404** - NotFoundErrorResponse: The pre recorded job doesn't exist or has been deleted. ``` -------------------------------- ### Streaming Request Parameters Source: https://docs.gladia.io/api-reference/v2/live/get Configuration options for setting up a live audio stream for transcription. ```APIDOC ## Streaming Request Parameters ### Description Configuration options for setting up a live audio stream for transcription. ### Properties - **encoding** (string) - Optional - The encoding format of the audio stream. Supported formats: PCM (8, 16, 24, and 32 bits), A-law (8 bits), μ-law (8 bits). Default: `wav/pcm`. - **bit_depth** (integer) - Optional - The bit depth of the audio stream. Default: `16`. - **sample_rate** (integer) - Optional - The sample rate of the audio stream. Default: `16000`. - **channels** (integer) - Optional - The number of channels of the audio stream. Minimum: `1`, Maximum: `8`. Default: `1`. - **model** (string) - Optional - The model used to process the audio. Default: `solaria-1`. - **endpointing** (number) - Optional - The endpointing duration in seconds. Minimum: `0.01`, Maximum: `10`. Default: `0.05`. - **maximum_duration_without_endpointing** (number) - Optional - The maximum duration in seconds without endpointing. Minimum: `5`, Maximum: `60`. Default: `5`. - **language_config** (object) - Optional - Specify the language configuration. - **pre_processing** (object) - Optional - Specify the pre-processing configuration. - **realtime_processing** (object) - Optional - Specify the realtime processing configuration. - **post_processing** (object) - Optional - Specify the post-processing configuration. - **messages_config** (object) - Optional - Specify the websocket messages configuration. - **callback** (boolean) - Optional - If true, messages will be sent to configured url. Default: `false`. - **callback_config** (object) - Optional - Specify the callback configuration. ``` -------------------------------- ### Get Transcription Details Source: https://docs.gladia.io/api-reference/v2/transcription/get Fetches the details of a specific transcription job. This includes configuration, status, and results. ```APIDOC ## GET /v2/transcription/{transcriptionId} ### Description Retrieves the details of a transcription job, including its status, configuration, and results. ### Method GET ### Endpoint /v2/transcription/{transcriptionId} ### Parameters #### Path Parameters - **transcriptionId** (string) - Required - The unique identifier of the transcription job. #### Query Parameters - **language** (string) - Optional - The language of the transcription to retrieve. If not specified, the original transcription language will be returned. - **with_words** (boolean) - Optional - If true, word-level details will be included in the response. - **with_speakers** (boolean) - Optional - If true, speaker diarization information will be included in the response. - **with_full_text** (boolean) - Optional - If true, the full text of the transcription will be included in the response. - **with_audio_url** (boolean) - Optional - If true, a URL to the processed audio file will be included in the response. - **with_subtitles** (string) - Optional - If provided with a valid format (srt, vtt), subtitles will be generated and included in the response. - **with_translation** (string) - Optional - If provided with a valid language code, the transcription will be translated to the specified language. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the transcription. - **status** (string) - The current status of the transcription job (e.g., `processing`, `completed`, `failed`). - **language** (string) - The language of the transcription. - **words** (array) - An array of word objects, each containing the word, start time, and end time (if `with_words` is true). - **speakers** (array) - An array of speaker objects, each containing speaker information (if `with_speakers` is true). - **full_text** (string) - The full text of the transcription (if `with_full_text` is true). - **audio_url** (string) - A URL to the processed audio file (if `with_audio_url` is true). - **subtitles** (string) - The transcription formatted as subtitles (if `with_subtitles` is provided). - **translation** (string) - The translated transcription (if `with_translation` is provided). #### Response Example ```json { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "status": "completed", "language": "en", "words": [ { "word": "Hello", "start": 0.5, "end": 1.0 }, { "word": "world", "start": 1.1, "end": 1.5 } ], "full_text": "Hello world", "audio_url": "https://api.gladia.io/v2/audio/processed/a1b2c3d4-e5f6-7890-1234-567890abcdef.mp3", "subtitles": "1\n00:00:00,500 --> 00:00:01,000\nHello\n\n2\n00:00:01,100 --> 00:00:01,500\nworld" } ``` ``` -------------------------------- ### InitStreamingResponse Source: https://docs.gladia.io/api-reference/v2/live/init This object represents the response received upon successfully initializing a live streaming session. It contains the necessary information to establish a WebSocket connection. ```APIDOC ## InitStreamingResponse ### Description This object represents the response received upon successfully initializing a live streaming session. It contains the necessary information to establish a WebSocket connection. ### Properties - **id** (string) - The unique identifier for the transcription job. - **created_at** (string) - The timestamp indicating when the job was created. - **url** (string) - The WebSocket URL to connect to for sending audio data. This URL includes a temporary token for authentication. ``` -------------------------------- ### Initialize Transcription Source: https://docs.gladia.io/api-reference/v2/transcription/init Initiates a new transcription job by providing the audio source and configuration options. The response contains the transcription job ID and a URL to fetch the results. ```APIDOC ## POST /v2/transcription ### Description Initiates a new transcription job for an audio file. You can specify various configuration options to customize the transcription process, such as enabling sentiment analysis, PII redaction, or custom metadata. ### Method POST ### Endpoint /v2/transcription ### Parameters #### Request Body - **audio_url** (string) - Required - URL to a Gladia file or to an external audio or video file. - **sentiment_analysis** (boolean) - Optional - Enable sentiment analysis for this audio. Defaults to false. - **audio_to_llm** (boolean) - Optional - Enable audio to llm processing for this audio. Defaults to false. - **audio_to_llm_config** (object) - Optional - Audio to llm configuration, if `audio_to_llm` is enabled. - **pii_redaction** (boolean) - Optional - Enable PII redaction for this audio. Defaults to false. - **pii_redaction_config** (object) - Optional - PII redaction configuration, if `pii_redaction` is enabled. - **custom_metadata** (object) - Optional - Custom metadata you can attach to this transcription. Example: `{"user": "John Doe"}`. - **sentences** (boolean) - Optional - Enable sentences for this audio. Defaults to false. - **punctuation_enhanced** (boolean) - Optional - Use enhanced punctuation for this audio. Defaults to false. - **language_config** (object) - Optional - Specify the language configuration. ### Request Example ```json { "audio_url": "http://files.gladia.io/example/audio-transcription/split_infinity.wav", "sentiment_analysis": true, "pii_redaction": true, "custom_metadata": { "user": "John Doe" }, "language_config": { "language": "en" } } ``` ### Response #### Success Response (200) - **id** (string) - Id of the job. - **result_url** (string) - Prebuilt URL with your transcription `id` to fetch the result. #### Response Example ```json { "id": "45463597-20b7-4af7-b3b3-f5fb778203ab", "result_url": "https://api.gladia.io/v2/transcription/45463597-20b7-4af7-b3b3-f5fb778203ab" } ``` ### Error Handling - **400 Bad Request**: Returned if the request is malformed or invalid. - **401 Unauthorized**: Returned if the API key is invalid or missing. - **422 Unprocessable Entity**: Returned if there are issues with the provided parameters, such as an invalid language code. ``` -------------------------------- ### On post chapterization Source: https://docs.gladia.io/api-reference/v2/live/websocket This message contains the informations about the post chapterization of the audio chunk. ```APIDOC ## PostChapterizationMessage ### Description This message contains the informations about the post chapterization of the audio chunk. ### Type `post_chapterization` ### Payload ```json { "session_id": "string", "created_at": "string", "type": "post_chapterization", "data": { "metadata": { "audio_duration": "number", "number_of_distinct_channels": "number", "billing_time": "number", "transcription_time": "number" }, "results": { "chapters": [ { "start_time": "number", "end_time": "number", "summary": "string" } ] } } } ``` ### Example ```json { "session_id": "550e8400-e29b-41d4-a716-446655440000", "created_at": "2025-09-19T12:45:00Z", "type": "post_chapterization", "data": { "metadata": { "audio_duration": 123.45, "number_of_distinct_channels": 1, "billing_time": 120, "transcription_time": 3.2 }, "results": { "chapters": [ { "start_time": 0.5, "end_time": 10.2, "summary": "Introduction to the topic." }, { "start_time": 10.5, "end_time": 25.8, "summary": "Detailed discussion of the main points." } ] } } } ``` ``` -------------------------------- ### Get Pre-recorded Audio Analysis Source: https://docs.gladia.io/api-reference/v2/pre-recorded/get Retrieve the analysis results for a pre-recorded audio file. This includes transcription, translation, and AI-generated insights. ```APIDOC ## GET /v2/pre-recorded/get ### Description Retrieves the analysis results for a pre-recorded audio file. This endpoint is used to fetch the processed data after an audio file has been submitted for analysis. ### Method GET ### Endpoint /v2/pre-recorded/get ### Query Parameters - **audio_url** (string) - Required - The URL of the pre-recorded audio file to analyze. - **webhook_url** (string) - Optional - A URL to send the results to once processing is complete. - **language** (string) - Optional - The language of the audio file (e.g., 'en', 'es', 'fr'). If not provided, the API will attempt to auto-detect the language. - **translate_to** (string) - Optional - The language to translate the transcription into (e.g., 'en', 'es', 'fr'). Requires the `language` parameter to be set or auto-detected. - **with_words** (boolean) - Optional - If true, includes word-level timestamps in the response. - **with_sentences** (boolean) - Optional - If true, includes sentence-level segmentation in the response. - **with_utterances** (boolean) - Optional - If true, includes speaker utterance segmentation in the response. - **with_speakers** (boolean) - Optional - If true, includes speaker diarization information in the response. - **with_emotions** (boolean) - Optional - If true, includes detected emotion analysis in the response. - **with_named_entities** (boolean) - Optional - If true, includes named entity recognition in the response. - **llm_prompt** (string) - Optional - A prompt to send to the LLM for analysis of the audio content. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the analysis job. - **status** (string) - The current status of the analysis job (e.g., 'processing', 'completed', 'failed'). - **results** (object) - Contains the analysis results once the job is completed. The structure of this object depends on the parameters requested. - **full_transcript** (string) - The complete transcription of the audio. - **words** (array) - Array of word objects with timestamps (if `with_words` is true). - **sentences** (array) - Array of sentence objects (if `with_sentences` is true). - **utterances** (array) - Array of utterance objects (if `with_utterances` is true). - **speakers** (array) - Array of speaker objects (if `with_speakers` is true). - **emotions** (array) - Array of emotion objects (if `with_emotions` is true). - **named_entities** (array) - Array of named entity objects (if `with_named_entities` is true). - **llm_response** (string) - The response from the LLM if `llm_prompt` was provided. #### Error Response (400, 401, 403, 404, 429, 500) - **error** (object) - Contains error details. - **status_code** (integer) - The HTTP status code of the error. - **exception** (string) - The type of exception that occurred. - **message** (string) - A detailed message explaining the error. ### Request Example ```bash curl -X GET \ 'https://api.gladia.io/v2/pre-recorded/get?audio_url=YOUR_AUDIO_URL&with_words=true&llm_prompt=Summarize the key points of this audio.' \ -H 'x-gladia-key: YOUR_API_KEY' ``` ### Response Example (Success) ```json { "id": "job_abc123", "status": "completed", "results": { "full_transcript": "Hello, this is a test transcript.", "words": [ {"word": "Hello", "start": 0.5, "end": 1.0, "confidence": 0.95}, {"word": "this", "start": 1.1, "end": 1.3, "confidence": 0.98} ], "llm_response": "The key points are about testing." } } ``` ### Response Example (Processing) ```json { "id": "job_abc123", "status": "processing", "results": null } ``` ```