Install & Compatibility
Where this runs
tested against v1.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.9
✕ build_error
✕ build_error
23MB installed
● package 23MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
GladiaClient
✓ from gladiaio_sdk import GladiaClient
✗ from gladia import GladiaClient
This quickstart demonstrates how to transcribe a pre-recorded audio file or URL using the Gladia Python SDK. It initializes the client with an API key from environment variables and then calls the `transcribe` method, including examples of language configuration and custom vocabulary for enhanced accuracy.
import os
from gladia import GladiaClient
# Ensure GLADIA_API_KEY is set in your environment variables
gladia_api_key = os.environ.get("GLADIA_API_KEY")
if not gladia_api_key:
raise ValueError("GLADIA_API_KEY environment variable not set. Please set your Gladia API key.")
gladia_client = GladiaClient(api_key=gladia_api_key)
# Replace with your audio file path or a publicly accessible URL
# Example: audio_source = "./path/to/your/audio.wav"
audio_source = "https://gladia.io/sample-audio/podcast_excerpt.mp3"
try:
print(f"Transcribing audio from: {audio_source}")
transcription = gladia_client.preRecorded().transcribe(
audio_source,
language_config={
"languages": ["en", "fr"],
"code_switching": True,
},
# Enable custom vocabulary for better accuracy on specific terms
custom_vocabulary=True,
custom_vocabulary_config={
"vocabulary": ["Gladia", "Solaria", "Salesforce"],
},
)
print("Transcription successful!")
print(f"Full Transcript: {transcription.result.transcription.full_transcript}")
except Exception as e:
print(f"An error occurred during transcription: {e}")
Debug
Known issues
breakingGladia's API has transitioned from V1 to V2. While the SDK is designed to abstract these changes, users migrating from older API integrations (or SDK versions tied to V1) should consult the official migration guides. V1 API support will be deprecated.fixEnsure you are using the latest `gladiaio-sdk` (version 1.0.0+) which targets API V2. Review Gladia's V1 to V2 migration guides for pre-recorded and live transcription if directly interacting with the API or using an older SDK.
affects: API V1 (older integrations), Gladia API V2 current
gotchaFor real-time (live) transcription, direct exposure of your Gladia API key in client-side applications (e.g., web or mobile frontends) is a security risk. It's best practice to initiate WebSocket sessions via a secure backend service to keep your API key private.fixImplement a backend endpoint to handle the `gladiaClient.liveV2().startSession()` call. This backend will securely generate the WebSocket URL and token, which can then be safely passed to your client-side application for connection.
affects: All versions
gotchaA single real-time transcription session has a maximum duration limit of 3 hours. Sessions exceeding this limit will be automatically terminated. For continuous transcription beyond 3 hours, new sessions must be initiated.fixMonitor session duration for long-running real-time applications. Implement logic to gracefully stop the current session and start a new one before reaching the 3-hour limit, ensuring seamless continuity for your users.
affects: All versions
gotchaPre-recorded audio transcription has specific file limits: maximum length of 135 minutes (or 120 minutes for direct YouTube links, 4h15 for enterprise plans) and a maximum file size of 1000 MB. Attempting to transcribe files exceeding these limits will result in an error.fixFor audio files exceeding these limits, preprocess them by splitting them into smaller chunks (e.g., around 60 minutes each) before passing them to the SDK for transcription. Ensure your input audio source is valid and accessible.
affects: All versions
Upgrade
Version history
1.0.2latest on PyPI · released Apr 16, 2026
Audit
Dependencies
pythonrequiredRequires Python versions 3.10 or higher, but less than 4.