Skip to main content
Language-specific patterns for integrating with the Modulate APIs. Each section covers the key patterns for that language: authentication setup, file upload, WebSocket connections, and error handling. For full per-endpoint request and response schemas, see the API Reference tab.

cURL

cURL works for all HTTP batch endpoints. WebSocket endpoints require a dedicated tool — see WebSocket testing below.

Batch file upload with optional features

Replace the endpoint and fields for other batch APIs. The X-API-Key header pattern is the same for all batch endpoints.

Deepfake Detection batch — minimal example

Python

Setup

Authentication — synchronous (requests)

Pass the API key in the headers dict. Reuse the session or headers across requests.

Authentication — async (aiohttp)

Batch file upload (aiohttp)

Concurrent batch processing

Use a semaphore to respect your organization’s concurrent request limit.

WebSocket streaming (aiohttp)

Applies to both the Multilingual Transcription streaming and Deepfake Detection streaming endpoints.

Error handling

JavaScript (Node.js)

Setup

Batch file upload (native fetch, Node 18+)

Batch file upload (form-data package, Node < 18 or streams)

Use the form-data package when you want to stream the file rather than reading it fully into memory.

WebSocket streaming (ws package)

Error handling

WebSocket testing

WebSocket APIs cannot be tested with cURL. Use websocat for command-line testing.