Speech-to-Text API
REST and real-time WebSocket speech recognition. 99 languages, sub-second streaming, zero retention, and Deepgram compatibility.
Introduction
The AICHE API provides fast, production-grade speech-to-text transcription via REST and real-time WebSocket connections. It is engineered with Whisper speech recognition, empirical hallucination filtering, and optional LLM cleanup.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
You can generate, revoke, and inspect usage for your API keys from your Account Settings. Keep your keys secret; do not expose secret keys in public client applications.
Transcribe Audio
/v1/transcribeSend pre-recorded audio files as Base64 or an HTTPS URL for rapid speech-to-text transcription.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
audio | string | Optional* | Base64-encoded audio payload (up to 100MB). |
audio_url | string | Optional* | Publicly accessible HTTPS URL pointing to the audio file. |
language | string | Optional | ISO 639-1 code (e.g. "en", "de", "es") or "auto" for automatic detection (default). |
translate | string | Optional | Translate the resulting transcript to another language (ISO 639-1 code). |
* Provide either audio or audio_url, not both. Supported formats: MP3, WAV, M4A, WebM, OGG, FLAC.
Quickstart request
Response format
Transcriptions are returned synchronously upon completion:
| Field | Type | Description |
|---|---|---|
text | string | The polished transcribed text with punctuation and formatting. |
duration_seconds | number | Audio duration processed, in seconds. |
language | string | Detected or specified ISO 639-1 language code. |
cost | number | Exact cost of this request in USD. |
Transcribe a file (Deepgram-compatible)
/v1/listenSend a finished audio recording and receive the transcript in Deepgram's pre-recorded JSON response format. Drop-in compatible with Deepgram SDKs and applications.
Send a finished recording and get the text back in Deepgram's response format. Applications built for Deepgram (such as mobile dictation keyboards, voice recorders, and ingest pipelines) work by changing the host to api.aiche.app and providing your AICHE API key. Both WebSocket streaming and pre-recorded POST requests work on /v1/listen, exactly like Deepgram.
Authentication & Request Body
Authentication: Pass your key via Deepgram-style Authorization: Token $AICHE_API_KEY, standard Authorization: Bearer $AICHE_API_KEY, or the X-API-Key header.
| Input Method | Content-Type | Payload & Limits |
|---|---|---|
| Raw binary audio | audio/* (or omitted) | Direct audio file bytes in request body: WAV, MP3, M4A/MP4, OGG/Opus, WebM, FLAC (up to 100 MB). |
| Remote URL (JSON) | application/json | JSON object: {"url": "https://..."}. The server downloads and transcribes the file. |
Query parameters
| Parameter | Default | Description |
|---|---|---|
language | multi | Language code such as "en", "nl", "de" (regional codes like "en-US" also work). Omit or set to "multi" to detect language automatically. |
model | default | Accepted and ignored for drop-in Deepgram compatibility. |
smart_format | true | Accepted and ignored (formatting and punctuation are always cleanly applied). |
punctuate | true | Accepted and ignored for compatibility. |
Quickstart request
Response format
The response matches Deepgram's pre-recorded JSON structure:
The transcribed text is in results.channels[0].alternatives[0].transcript. Word timings (words) and speaker diarization are not provided yet.
Limits & Pricing
- File size limit: Up to 100 MB per file.
- Test API keys (sk_test_): Accept up to 2 minutes of audio and are free of charge.
- Live keys: Billed at the same rate as /v1/transcribe ($0.36/hour, or $0.0001 per second) from your API balance.
- Errors: Returned as standard JSON: {"detail": {"error": "...", "message": "..."}} with HTTP 400 (bad or missing audio), 401 (bad key), 402 (insufficient balance), 413 (file too large), or 429 (rate limit).
Real-Time Streaming
/v1/listenStream raw PCM audio frames over a WebSocket connection and receive real-time interim and final transcripts.
The streaming WebSocket API is engineered to be drop-in compatible with the Deepgram WebSocket protocol, allowing existing Deepgram clients and SDKs to connect with just a URL update.
Connection parameters
| Parameter | Default | Description |
|---|---|---|
encoding | linear16 | Audio encoding. Signed 16-bit little-endian PCM. |
sample_rate | 16000 | Sample rate in Hz. Must be 16000. |
channels | 1 | Audio channels. Must be 1 (mono). |
punctuate | true | Automatically add punctuation and capitalization to transcripts. |
interim_results | true | Send fast partial results while speech is in progress. |
vad_events | false | Send SpeechStarted events when voice is detected. |
utterance_end_ms | 1000 | Silence duration before considering an utterance finished (200 to 5000ms). |
language | auto | Language code (en, es, de, etc.) or auto-detect. |
Streaming implementation
Audio format requirements
| Specification | Requirement | Details |
|---|---|---|
| Encoding | Raw PCM (linear16) | Signed 16-bit integer, little-endian. |
| Sample rate | 16,000 Hz | Single-channel mono. |
| Frame size | 50ms to 200ms | 800 to 3,200 samples per binary WebSocket frame. |
| Container | Raw binary bytes | Do not send WAV/MP3 container headers. |
WebSocket Messages
Client to Server messages
Send raw audio as binary frames. For control signals, send JSON text frames:
{"type": "KeepAlive"}{"type": "Finalize"}{"type": "CloseStream"}Server to Client messages
The server streams JSON messages indicating connection state, partials, and final transcripts:
| is_final | speech_final | State Meaning |
|---|---|---|
false | false | Interim partial result. Text may update as user continues speaking. |
true | true | Final utterance result. Speaker paused; text is finalized and punctuate-polished. |
true | true (from_finalize: true) | Response generated after Finalize or CloseStream. |
Deepgram Drop-in Migration
If your application already uses Deepgram for streaming or pre-recorded transcription, you can switch to AICHE in under 60 seconds with zero code refactoring:
wss://api.deepgram.com/v1/listen to wss://api.aiche.app/v1/listen. For pre-recorded files, change POST https://api.deepgram.com/v1/listen to POST https://api.aiche.app/v1/listen.Authorization: Token $AICHE_API_KEY or ?token=$AICHE_API_KEY.SDK & Language Examples
Quick copy-paste snippets for cURL, Python, and Node.js:
API Pricing & Voice Activity Detection
Simple, transparent pay-as-you-go billing with no recurring commitments or tier traps:
| Service | Rate | Billing Unit | Notes |
|---|---|---|---|
/v1/transcribe | $0.36 / hour | Per second ($0.0001/s) | Synchronous REST transcription |
POST /v1/listen | $0.36 / hour | Per second ($0.0001/s) | Pre-recorded file transcription (Deepgram format) |
WSS /v1/listen | $0.36 / hour | Per second ($0.0001/s) | Billed strictly on detected speech time (silence free) |
Rate Limits & Concurrency
| Limit Parameter | Standard Limit | Description |
|---|---|---|
| Requests per minute | 100 req/min | Burst rate limit across all REST endpoints. |
| Concurrent connections | 10 streams | Concurrent active WebSocket streams. |
| Maximum payload size | 100 MB | Maximum audio file size per single request. |
Rate limit status is returned on all responses via headers: X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset. Need higher volume? Contact developer support.
Endpoint Summary
| Method | Endpoint Path | Type | Description |
|---|---|---|---|
| POST | /v1/transcribe | REST | Synchronous audio transcription from URL or base64 payload. |
| POST | /v1/listen | REST | Pre-recorded file transcription with Deepgram-compatible response format. |
| GET | /v1/jobs | REST | List asynchronous transcription jobs. |
| GET | /v1/jobs/{id} | REST | Inspect asynchronous job progress and retrieve results. |
| WSS | /v1/listen | WebSocket | Low-latency real-time streaming speech-to-text. |
All endpoints are relative to the production base URL https://api.aiche.app/v1.