Build with the
languu API.
Integration guides, a complete API reference, and the mock-mode runbook for previewing the UI without the AWS backend. One key gets you translation, transcription, text-to-speech, and closed captioning.
Integration guides
Copy-paste recipes for each service in cURL and JavaScript, from first request to production.
API reference
Every endpoint, parameter, and response field across all four language services.
Mock-mode runbook
Run the full frontend against deterministic fixtures — no AWS, no credentials, no cost.
Authentication
Every request authenticates with a secret API key sent as a Bearer token. Generate keys in the dashboard under Settings → API keys. Keep secret keys server-side; never ship a lang_sk_ key to the browser.
curl https://api.languu.com/v1/translate \ -H "Authorization: Bearer lang_sk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "text": "Hello world", "target": "ko" }'
Use lang_sk_test_ keys while building. Test keys return realistic responses, skip billing, and pair naturally with mock mode for offline development.
Errors & limits
The API uses conventional HTTP status codes. Failures return a JSON body with a stable code string you can branch on and a human-readable message for logs.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request | A parameter is missing or malformed. |
| 401 | auth_failed | Missing, revoked, or invalid API key. |
| 413 | payload_too_large | Input exceeds the size limit for the endpoint. |
| 429 | rate_limited | Too many requests — back off and retry. |
| 503 | service_unavailable | Transient backend issue; safe to retry. |
Default limits are 60 requests/minute for text endpoints and 10 concurrent jobs for media. Responses include X-RateLimit-Remaining and Retry-After headers. Need more? Contact support to lift limits per workspace.
Translation
Translate text between 30+ languages with tone and glossary controls. Send text (string or array) plus a target language; omit source to auto-detect.
const res = await fetch("https://api.languu.com/v1/translate", { method: "POST", headers: { "Authorization": `Bearer ${process.env.LANGUU_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ text: "The quick brown fox.", target: "ko", // Korean formality: "formal" // "formal" | "casual" | "default" }) }); const { translations } = await res.json(); console.log(translations[0].text);
Pass a glossary_id to enforce brand terms, or send text as an array to translate up to 100 strings in one call while preserving order.
Transcription
Convert audio or video to time-stamped text. Submit a publicly reachable media_url (or upload via the signed-URL flow) and poll the returned job until status is completed.
curl https://api.languu.com/v1/transcribe \ -H "Authorization: Bearer $LANGUU_KEY" \ -H "Content-Type: application/json" \ -d '{ "media_url": "https://cdn.example.com/interview.mp3", "language": "auto", "diarize": true, "timestamps": "word" }' # → { "id": "txn_8fa2", "status": "processing" }
Set diarize: true to label speakers and timestamps to "word" or "segment". Provide a webhook_url and skip polling — languu posts the finished transcript to your endpoint.
Text to speech
Generate natural speech from text. Choose a voice, optionally tune speed and format, and stream or download the audio.
const res = await fetch("https://api.languu.com/v1/speech", { method: "POST", headers: { "Authorization": `Bearer ${process.env.LANGUU_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ text: "Welcome to languu.", voice: "aria", // list voices at /v1/voices format: "mp3", // "mp3" | "wav" | "ogg" speed: 1.0 }) }); const audio = await res.arrayBuffer();
For long passages, send stream: true to receive chunked audio as it renders. SSML is supported in the text field for pauses, emphasis, and pronunciation.
Closed captioning
Produce broadcast-ready captions from media in a single job. Captioning chains transcription and (optionally) translation, then returns subtitle files in the formats you request.
curl https://api.languu.com/v1/captions \ -H "Authorization: Bearer $LANGUU_KEY" \ -H "Content-Type: application/json" \ -d '{ "media_url": "https://cdn.example.com/lecture.mp4", "formats": ["srt", "vtt"], "translate_to": ["es", "ja"], "max_chars_per_line": 42 }'
The completed job returns a download URL per format per language. Use max_chars_per_line and max_lines to match your platform's caption style guide.
API reference
All endpoints are rooted at https://api.languu.com/v1 and accept and return JSON unless noted.
| Field | Type | Description |
|---|---|---|
| text * | string | string[] | Content to translate. Up to 100 items. |
| target * | string | ISO target language code. |
| source | string | Source code. Auto-detected if omitted. |
| formality | string | formal, casual, or default. |
| glossary_id | string | Apply a saved term glossary. |
| Field | Type | Description |
|---|---|---|
| media_url * | string | Reachable URL of the audio/video file. |
| language | string | Source language or auto. |
| diarize | boolean | Label distinct speakers. |
| timestamps | string | word or segment. |
| webhook_url | string | POST target for the finished job. |
| Field | Type | Description |
|---|---|---|
| text * | string | Plain text or SSML to synthesize. |
| voice * | string | Voice ID from /v1/voices. |
| format | string | mp3, wav, or ogg. |
| speed | number | 0.5–2.0. Defaults to 1.0. |
| stream | boolean | Chunk audio as it renders. |
| Field | Type | Description |
|---|---|---|
| media_url * | string | Reachable URL of the source media. |
| formats | string[] | srt, vtt, ttml. |
| translate_to | string[] | Target codes for translated captions. |
| max_chars_per_line | number | Line-length cap per caption. |
Retrieve the status and result of any media job (transcribe or captions). Returns status of processing, completed, or failed, plus the output payload once finished.
Mock-mode runbook
Mock mode runs the entire languu frontend against deterministic local fixtures instead of the AWS backend. Use it to preview the UI, develop offline, run UI tests in CI, and demo flows without API keys, network access, or billing.
When NEXT_PUBLIC_API_URL is unset or set to mock, the frontend uses in-browser mocks. For a local REST API, run npm run local:mock-api in backend/ and point NEXT_PUBLIC_API_URL at http://127.0.0.1:3333.
Enable mock mode
Install dependencies
From the project root, install once.
bashcd frontend && npm install cd ../backend && npm install
Set the environment flag
Add this to
frontend/.env.localfor in-browser mocks, or use the local mock API URL.env · .env.local# In-browser mocks only: NEXT_PUBLIC_API_URL=mock # Or local mock REST API (run: cd backend && npm run local:mock-api): # NEXT_PUBLIC_API_URL=http://127.0.0.1:3333
Run the dev server
Start as usual — no live API key required when using mock mode.
bashcd frontend npm run dev # ▲ ready on http://localhost:3000
How fixtures resolve
In-browser mock mode short-circuits API calls with stable sample responses. The local mock API serves the same shapes from backend/scripts/local-rest-api.ts. Media jobs return processing on creation, then completed on poll.
| Endpoint | Fixture | Notes |
|---|---|---|
| /translate | frontend mocks | Sample translation with detected language. |
| /transcribe | local-rest-api | Word-level timestamps and transcript text. |
| /tts | sample audio URL | Short static audio clip. |
| /captioning | SRT / VTT samples | Downloadable caption files. |
Switching back to live
Set NEXT_PUBLIC_API_URL to your deployed API Gateway URL from CDK output. Authenticate with Cognito via the app login flow — no code changes required.
E2E tests run against mock mode by default. See frontend/cypress/support/e2e.ts and run npm run test:e2e from the frontend package.