# GPT Live Transcribe

Model id on AIHubMix: `gpt-live-transcribe`
Create an API key: https://console.aihubmix.com/?utm_source=llms-agent&utm_medium=model-llms

> OpenAI's latest realtime speech-to-text model, built for low-latency use — it streams incremental transcripts as audio arrives, ideal for live captions, dictation, and voice interfaces. Supports automatic transcription across 57 languages, with keyword/context hints and a tunable latency-vs-accuracy tradeoff.

- Developer: OpenAI
- Session kind: realtime WebSocket — speech-to-text transcription
- Input modalities: audio, text
- Release date: 2026-07-28
- Pricing: see https://aihubmix.com/model/gpt-live-transcribe (realtime is billed on audio + text tokens)

## Endpoints (base URL: https://aihubmix.com)

- `GET wss://aihubmix.com/v1/realtime?intent=transcription&model=gpt-live-transcribe` — realtime speech-to-text transcription over WebSocket. Authenticate the handshake with `Authorization: Bearer $AIHUBMIX_API_KEY`. The model id is carried in the handshake query above (with `intent=transcription`); audio is PCM16 / 24kHz / mono in both directions.

## Example

```python
# pip install websockets
import asyncio
import base64
import json
import os
import websockets

# Realtime transcription is a WebSocket session: model must be in the handshake URL.
URL = "wss://aihubmix.com/v1/realtime?intent=transcription&model=gpt-live-transcribe"

async def main():
    # websockets >= 13 uses additional_headers; older versions use extra_headers
    async with websockets.connect(
        URL, additional_headers={"Authorization": "Bearer " + os.environ["AIHUBMIX_API_KEY"]}
    ) as ws:
        # 1) Configure the transcription session (first frame; server VAD auto-segments speech as you stream)
        await ws.send(json.dumps({
          "type": "session.update",
          "session": {
            "type": "transcription",
            "audio": {
              "input": {
                "format": {
                  "type": "audio/pcm",
                  "rate": 24000
                },
                "transcription": {
                  "model": "gpt-live-transcribe"
                },
                "turn_detection": {
                  "type": "server_vad"
                }
              }
            }
          }
        }))

        flushed = asyncio.Event()  # set once the whole stream is sent + flushed

        # 2) Stream raw PCM16 / 24kHz / mono audio in ~100ms chunks
        async def send_audio():
            with open("audio_pcm16_24k.raw", "rb") as f:
                pcm = f.read()
            chunk = 24000 * 2 * 100 // 1000  # 100ms of 16-bit mono samples
            for i in range(0, len(pcm), chunk):
                await ws.send(json.dumps({
                    "type": "input_audio_buffer.append",
                    "audio": base64.b64encode(pcm[i:i + chunk]).decode(),
                }))
                await asyncio.sleep(0.1)  # simulate realtime pacing
            # Server VAD segments on pauses; flush any trailing audio at end of stream
            await ws.send(json.dumps({"type": "input_audio_buffer.commit"}))
            flushed.set()

        asyncio.create_task(send_audio())

        # 3) Receive events: deltas stream live; each pause finalizes a segment (server VAD)
        async for msg in ws:
            evt = json.loads(msg)
            etype = evt.get("type", "")
            if etype.endswith("transcription.delta"):
                print(evt.get("delta", ""), end="", flush=True)
            elif etype.endswith("transcription.completed"):
                print("\n[segment]", evt.get("transcript", ""))
                if flushed.is_set():  # last segment after the final flush → done
                    break
            elif etype == "error":
                print("\n[error]", evt.get("error"))
                break

asyncio.run(main())
```

## Response

Realtime transcription is an **event stream over one WebSocket**, not a single JSON body. After the first `session.update`, stream raw PCM16 / 24kHz / mono audio as `input_audio_buffer.append` frames; server VAD segments speech on pauses. Read events until done:

- `*.transcription.delta` — partial text as it is recognized (`delta` field)
- `*.transcription.completed` — a finalized segment (`transcript` field)
- `error` — a session-level error; the socket closes

No HTTP response body and no `stream: true` flag — the transport itself is the stream.

## Errors

Error responses carry a `tid` (trace id) — include it when contacting support. Reference: https://docs.aihubmix.com/en/FAQs/HTTP-Codes.md

- 400 — parameter error; most are passed through from the upstream provider (media: `prompt_missing`, `size_not_supported`, `n_not_within_range`, …)
- 401 — missing `Authorization` header, or the key is invalid/expired
- 403 — `insufficient_user_quota` (top up at https://console.aihubmix.com/?utm_source=llms-agent&utm_medium=model-llms), account suspended, or this key is not allowed to use this model
- 429 — rate limited; back off and retry
- 503 — no channel can serve the request (check the model id and your access), or the upstream provider is throttling; retry later

## More

- Model page: https://aihubmix.com/model/gpt-live-transcribe
- Try in browser: https://aihubmix.com/playground?model=gpt-live-transcribe
- Full parameter schema (machine-readable, authoritative): https://aihubmix.com/model-data/models/gpt-live-transcribe.96833760.json — per-protocol parameters with types, ranges, enums and defaults. Refreshed together with this page; if it ever 404s, re-resolve via `https://aihubmix.com/model-data/index.json`
- Generate runnable code programmatically: npm `@aihubmix/codegen` — the generator behind the Playground's "Get Code" (this realtime example was produced by its `generateRealtimeCode`; 7 languages, media and realtime included); the session frames it builds are the exact frames the gateway receives, so generated snippets and real requests cannot diverge
- Site index for agents: https://aihubmix.com/llms.txt · Onboarding: https://aihubmix.com/agents.md

---

Canonical version of this document: https://aihubmix.com/model/gpt-live-transcribe/llms.txt
