Get started with Lanson Live API

Next

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

  1. Sign in to Lanson Live App, or create a free account.
  2. Open the API Key Console. This is the Developer panel in your Live account.
  3. Click Create API key. A label is optional (for example, Production server).
  4. 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.

Get an API key →

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.

SettingValue
Endpointwss://audio.lansonai.com/v1/audio/transcriptions/stream
Server authenticationAuthorization: Bearer sk-...
Browser authenticationShort-lived access_token issued by your backend
AudioPCM16LE, 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=$RT

Before 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.

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"

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 }
    }
  }
}

Next steps