Developer notes

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.

Base URL api.languu.com/v1Auth Bearer keyFormat JSON · RESTStability v1 · stable
01

Integration guides

Copy-paste recipes for each service in cURL and JavaScript, from first request to production.

02

API reference

Every endpoint, parameter, and response field across all four language services.

03

Mock-mode runbook

Run the full frontend against deterministic fixtures — no AWS, no credentials, no cost.

Getting started

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.

bash · authenticated request
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" }'
Tip

Use lang_sk_test_ keys while building. Test keys return realistic responses, skip billing, and pair naturally with mock mode for offline development.

Conventions

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.

StatusCodeMeaning
400invalid_requestA parameter is missing or malformed.
401auth_failedMissing, revoked, or invalid API key.
413payload_too_largeInput exceeds the size limit for the endpoint.
429rate_limitedToo many requests — back off and retry.
503service_unavailableTransient 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.

Integration guide

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.

javascript · translate.js
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.

Integration guide

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.

bash · create a transcription job
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.

Integration guide

Text to speech

Generate natural speech from text. Choose a voice, optionally tune speed and format, and stream or download the audio.

javascript · speech.js
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.

Integration guide

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.

bash · generate captions
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.

Reference

API reference

All endpoints are rooted at https://api.languu.com/v1 and accept and return JSON unless noted.

POST/v1/translate
FieldTypeDescription
text *string | string[]Content to translate. Up to 100 items.
target *stringISO target language code.
sourcestringSource code. Auto-detected if omitted.
formalitystringformal, casual, or default.
glossary_idstringApply a saved term glossary.
POST/v1/transcribe
FieldTypeDescription
media_url *stringReachable URL of the audio/video file.
languagestringSource language or auto.
diarizebooleanLabel distinct speakers.
timestampsstringword or segment.
webhook_urlstringPOST target for the finished job.
POST/v1/speech
FieldTypeDescription
text *stringPlain text or SSML to synthesize.
voice *stringVoice ID from /v1/voices.
formatstringmp3, wav, or ogg.
speednumber0.5–2.0. Defaults to 1.0.
streambooleanChunk audio as it renders.
POST/v1/captions
FieldTypeDescription
media_url *stringReachable URL of the source media.
formatsstring[]srt, vtt, ttml.
translate_tostring[]Target codes for translated captions.
max_chars_per_linenumberLine-length cap per caption.
GET/v1/jobs/:id

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.

Runbook

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.

What it does

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

  1. Install dependencies

    From the project root, install once.

    bash
    cd frontend && npm install
    cd ../backend && npm install
  2. Set the environment flag

    Add this to frontend/.env.local for 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
  3. Run the dev server

    Start as usual — no live API key required when using mock mode.

    bash
    cd 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.

EndpointFixtureNotes
/translatefrontend mocksSample translation with detected language.
/transcribelocal-rest-apiWord-level timestamps and transcript text.
/ttssample audio URLShort static audio clip.
/captioningSRT / VTT samplesDownloadable 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.

Cypress / E2E

E2E tests run against mock mode by default. See frontend/cypress/support/e2e.ts and run npm run test:e2e from the frontend package.