Gladia API Documentation
Explore the APIs and tools available for integrating Gladia's AI communication services into your applications.
Overview
Gladia provides a suite of AI-powered communication APIs for voice, video, and chat. Our platform allows developers to integrate real-time speech-to-text transcription, video analytics, and intelligent conversation models into their applications. This documentation guide will help you get started with integrating and using Gladia's APIs.
Getting Started
To begin using the Gladia API, you need an API key. You can obtain one by signing up on our website. Once you have your API key, you can include it in your requests for authentication.
curl -X POST https://api.gladia.com/v1/voice/transcribe \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@your-audio-file.wav" \
-F "language=english"
Replace YOUR_API_KEY
with your actual API key. Supported file formats include WAV, MP3, and PCM.
API Reference
Below are the key endpoints available in the Gladia API:
Voice Recognition
Convert speech to text with high accuracy.
Parameter | Type | Description |
---|---|---|
file | file | Audio file to transcribe |
language | string | Language of the audio |
model | string | Speech-to-text model to use |
Video Analytics
Analyze video content with AI-driven insights.
Currently, video analytics requires file upload similar to voice recognition.
curl -X POST https://api.gladia.com/v1/video/analyze \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "video=@your-video-file.mp4"
Authentication
All API requests must be authenticated with a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
You can find your API key on your account page. Keep it secure and avoid sharing it publicly.
Examples
Here are example integrations using Gladia's API in different programming languages.
JavaScript (Node.js)
const fetch = require('node-fetch');
const form = new FormData();
form.append('file', fs.createReadStream('audio.wav'));
form.append('language', 'english');
fetch('https://api.gladia.com/v1/voice/transcribe', {
method: 'POST',
body: form,
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));
Python
import requests
url = 'https://api.gladia.com/v1/voice/transcribe'
headers = {'Authorization': 'Bearer YOUR_API_KEY'}
data = {'language': 'english'}
files = {'file': open('audio.wav', 'rb')}
response = requests.post(url, headers=headers, data=data, files=files)
print(response.json())