Loading...
Loading...
Install and configure the official Gladia SDKs (@gladiaio/sdk for JS/TS, gladiaio-sdk for Python). Use when the user asks about SDK setup, client initialization, API key configuration, choosing between JS and Python, browser usage, retry/timeout settings, error handling, or SDK vs raw API decisions. The SDK is the recommended default for all Gladia integrations.
npx skill4agent add karamouche/skills sdk-integrationThe SDK is the default for all Gladia integrations. Always use the SDK unless there is a specific, documented reason not to (see decision guide below).
| Scenario | Approach |
|---|---|
| Any JS/TS or Python project | SDK — always |
| Browser app | SDK — JS SDK supports ESM/IIFE bundles |
| Need custom HTTP client or middleware | SDK first; use |
| Language without an SDK (Go, Java, etc.) | Raw REST/WebSocket (SDK unavailable) |
| User explicitly requests raw calls | Raw REST/WebSocket |
| CI script or one-off curl test | Raw REST is acceptable |
npm install @gladiaio/sdk
# or
bun add @gladiaio/sdk
# or
yarn add @gladiaio/sdkpip install gladiaio-sdk
# or
uv add gladiaio-sdkimport { GladiaClient } from "@gladiaio/sdk";
const client = new GladiaClient({
apiKey: "your-api-key", // or set GLADIA_API_KEY env var
region: "eu-west", // or set GLADIA_REGION (eu-west | us-west)
});from gladiaio_sdk import GladiaClient
client = GladiaClient(
api_key="your-api-key", # or set GLADIA_API_KEY env var
region="eu-west", # or set GLADIA_REGION
)| Variable | Purpose | Default |
|---|---|---|
| API key for authentication | — |
| Base API URL | |
| Datacenter region | — |
GladiaClient
├── preRecorded() → PreRecordedV2Client (JS)
│ prerecorded() → PreRecordedV2Client (Python)
│
├── liveV2() → LiveV2Client (JS)
│ live() → LiveV2Client (Python)
│
└── (Python only)
├── prerecorded_async() → AsyncPreRecordedV2Client
└── live_async() → AsyncLiveV2Client| Method | Purpose |
|---|---|
| High-level: upload + create + poll |
| Upload local file to |
| Create transcription job |
| Create + poll until done |
| Poll until complete |
| Get job status/results |
| Delete job and data |
| Download original audio |
| Method | Purpose |
|---|---|
| Init session → returns LiveV2Session |
| Get completed session results |
| Delete session and data |
| Download session audio |
| Method | Purpose |
|---|---|
| Stream audio bytes to the session |
| End recording, trigger post-processing |
| Force close without post-processing |
| Await session ID (async) |
apiKeyapiUrlregionhttpTimeouthttpRetrywsRetrywsTimeoutprerecordedTimeoutsliveTimeouts| Input | JS/TS | Python |
|---|---|---|
| Local file path (string) | Node only | Yes |
| — | Yes |
| HTTP(S) URL | Yes | Yes |
| Browser | — |
Binary file object ( | — | Yes |
audio_url/v2/uploadtry {
const result = await client.preRecorded().transcribe("./audio.mp3", options);
} catch (error) {
if (error.message.includes("401")) {
console.error("Invalid API key");
} else if (error.message.includes("timeout")) {
console.error("Request timed out");
}
}from gladiaio_sdk import GladiaClient
try:
result = client.prerecorded().transcribe("audio.mp3", options)
except Exception as e:
print(f"Error: {e}")HttpErrorTimeoutError| Aspect | JavaScript/TypeScript | Python |
|---|---|---|
| Async model | Promise-based (async only) | Sync + async (separate clients) |
| Naming | camelCase ( | snake_case ( |
| Browser support | Yes (ESM, CJS, IIFE) | No (server only) |
| Runtime | Node 20+, Bun, browsers | Python 3.10+ |
| Dependencies | 0 runtime deps (optional | httpx, websockets, pyee |
| Options format | Plain objects (snake_case keys) | Dataclasses or dicts |
| Untyped API | | Dict accepted on most methods |
import type {
LiveV2InitRequest,
LiveV2WebSocketMessage,
PreRecordedV2Response,
PreRecordedV2TranscriptionOptions,
} from "@gladiaio/sdk";from gladiaio_sdk import (
LiveV2InitRequest,
LiveV2WebSocketMessage,
LiveV2LanguageConfig,
LiveV2MessagesConfig,
PreRecordedV2Response,
)