Get started with Lanson Live API
Connect to live speech first, then choose Segment or Batch for other audio workflows.
Start streaming speech with Lanson Live API, then use Segment for speech clips or Batch for recordings.
1. Get an API key
- Sign in to Lanson Live App, or create a free account.
- Open the API Key Console. This is the Developer panel in your Live account.
- Click Create API key. A label is optional (for example,
Production server). - Copy the key when it is shown. It starts with
sk-and is displayed only once.
You can also open the console from the Developer button in the Live page header — it is visible even before you sign in.
New API developer accounts include $5 of free credit. Usage is charged in USD at the published API rates; when the balance is low, top up from the same Developer panel.
The plaintext key is returned only once at provisioning time. The server stores only a SHA-256 hash. Save it immediately.
2. Connect to live speech
Use the Realtime WebSocket path when your application receives live microphone audio. It runs speech segmentation on the server and delivers completed text for each utterance.
| Setting | Value |
|---|---|
| Endpoint | wss://audio.lansonai.com/v1/audio/transcriptions/stream |
| Server authentication | Authorization: Bearer sk-... |
| Browser authentication | Short-lived access_token issued by your backend |
| Audio | PCM16LE, 16 kHz, mono, sent as base64 JSON frames |
On your server, you can connect using your API key. In a browser, obtain a session token through your own backend; never ship the API key to the browser. See Authentication.
BASE="https://audio.lansonai.com"
SK="sk-..."
# Run on your backend to issue a short-lived browser session token.
RT=$(curl -s -X POST "$BASE/v1/audio/transcriptions/session-token" \
-H "Authorization: Bearer $SK" | jq -r .token)
# Browser connection URL:
# wss://audio.lansonai.com/v1/audio/transcriptions/stream?access_token=$RTBefore sending audio, configure its language when known:
{ "type": "session.update", "language": "en" }Then stream audio frames containing your captured PCM audio (the placeholder below is not a literal audio payload):
{ "type": "input_audio_buffer.append", "audio": "<base64 PCM16LE>" }Continue sending audio, including natural pauses, so server-side VAD can detect utterance boundaries. Do not treat a flush message or socket close as a guarantee that the last transcript was delivered.
For Node.js, Python, and browser connection examples, continue with Realtime Quickstart. For microphone capture and PCM encoding, use the Browser Live Captions guide.
3. Receive stable text
The primary event is conversation.item.input_audio_transcription.completed. A representative result is:
{
"type": "conversation.item.input_audio_transcription.completed",
"utterance_index": 0,
"text": "The weather is nice today",
"raw_text": "The weather is nice today",
"language": "en",
"language_source": "client",
"language_provisional": false,
"audio_duration_ms": 3200,
"latency_ms": 124,
"transcript": {
"state": "stable",
"revision": 0,
"safe_for_downstream": true,
"correction_applied": false
}
}Order results by utterance_index and display text. The current endpoint emits one completed result per successfully processed utterance, rather than a stream of partial-text revisions.
StableStream™ describes stable, readable live text. LiveFinal™ describes correction and segment finalization: when refinement is enabled, it runs before the completed event is delivered. Refinement is off by default. The default lite profile is included in the base transcription price; pro is billed as the realtime refinement add-on. See LiveFinal™ and Server Events.
Passing a known language is recommended. Omit it or send auto to use detection. language_provisional: true means detection is undecided; a detection error sets safe_for_downstream to false. A true value is not a guarantee of transcription accuracy.
4. Choose another audio path
Segment: send a speech clip
If your application already detects utterance boundaries, send each clip synchronously:
curl -X POST "$BASE/v1/audio/transcriptions" \
-H "Authorization: Bearer $SK" \
-F "file=@utterance.wav" \
-F "language=en"The response is 200 OK with the transcript. Segment requires an explicit language and does not filter silence. See Segment API.
Batch: process a recording
Submit a public URL, get a workflow id (local…), poll for the result:
BASE="https://audio.lansonai.com"
SK="sk-..."
curl -X POST "$BASE/v1/audio/transcriptions/jobs" \
-H "Authorization: Bearer $SK" \
-H "Content-Type: application/json" \
-d '{ "audio_url": "https://cdn.example.com/audio/meeting.wav" }'Response (202 Accepted):
{
"request_id": "...",
"workflow_id": "local...",
"status": "queued",
"poll_endpoint": "GET /v1/audio/transcriptions/jobs/local..."
}Poll:
curl "$BASE/v1/audio/transcriptions/jobs/<workflow_id>" \
-H "Authorization: Bearer $SK"Batch jobs run LLM correction by default. Add "review": false to the request body to get the raw transcript and skip the extra latency.
When the job reaches complete, its output includes the transcript:
{
"workflow_id": "...",
"status": "complete",
"output": {
"result": {
"segments": [
{ "id": 0, "start_time": 0.0, "end_time": 3.2, "text": "The weather is nice today", "confidence": 0.95, "timing": "estimated" }
],
"summary": { "total_duration": 120.5, "num_segments": 45 },
"metadata": { "language": "zh", "chunk_count": 3 }
}
}
}With review on (the default), the result also includes raw_segments and metadata.correction. confidence is 0 when the upstream does not provide a value.
Next steps
- Realtime Quickstart — full WebSocket examples
- Transcribe Audio — offline transcription details
- Authentication — auth methods and browser security
- LiveFinal™ — correction and delivery behavior