New: Audio API, Embeddings & Realtime WebSocket now available!
osmAPI LogoosmAPI

Realtime API

Realtime API

WSS /v1/realtime?model={model}&intent={intent}

WebSocket endpoint for real-time bidirectional audio streaming. Proxies to OpenAI's Realtime API.

Connection

const ws = new WebSocket(
  "wss://api.osmapi.com/v1/realtime?model=gpt-realtime",
  {
    headers: {
      "Authorization": "Bearer $OSM_API_KEY"
    }
  }
);

Note: The gateway adds the OpenAI-Beta: realtime=v1 header automatically.

Query Parameters

ParameterTypeRequiredDescription
modelstringYesgpt-realtime or gpt-realtime-mini
intentstringNotranscription for transcription-only mode

Models

ModelText PriceAudio Price
gpt-realtime$4/$16 per 1M tokens$32/$64 per 1M audio tokens
gpt-realtime-mini$1/$4 per 1M tokens$8/$16 per 1M audio tokens

Transcription Mode

For streaming transcription only (no conversation):

const ws = new WebSocket(
  "wss://api.osmapi.com/v1/realtime?model=gpt-realtime&intent=transcription"
);

Authentication

Pass your OSM API key as a Bearer token in the WebSocket connection headers.

See the Realtime feature guide for detailed usage examples.

How is this guide?