Create Transcription Session
Create Transcription Session
POST /v1/realtime/transcription_sessions
Creates an ephemeral token for WebSocket-based real-time streaming transcription.
Request
Content-Type: application/json
curl -X POST "https://api.osmapi.com/v1/realtime/transcription_sessions" \
-H "Authorization: Bearer $OSM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input_audio_transcription": {"model": "whisper-1"}}'Note: Request body is passed through to OpenAI. See OpenAI documentation for available parameters.
Response
Returns an ephemeral session with a client secret for establishing a WebSocket transcription connection.
Usage
Use the returned token to connect to the Realtime WebSocket with intent=transcription:
const session = await fetch("/v1/realtime/transcription_sessions", { ... });
const { client_secret } = await session.json();
// Connect to wss://api.osmapi.com/v1/realtime?intent=transcriptionSee the Realtime feature guide for detailed usage.
How is this guide?