{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreihabe2yviexyrpgwuu5v6lynelz4kf37qhtovt74c5qumblhq2z6a",
"uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mlojqp4ljbi2"
},
"path": "/t/gpt-realtime-2-ga-api-what-is-the-correct-audio-format-for-g711-ulaw-twilio-telephony/1380750#post_1",
"publishedAt": "2026-05-12T18:37:24.000Z",
"site": "https://community.openai.com",
"textContent": "Migrating from gpt-realtime-1.5 (beta) to gpt-realtime-2 (GA API) for a Twilio-based voice agent. The GA API rejects the old flat input_audio_format / output_audio_format parameters and requires a nested session.audio.input.format object, but the correct type value for G.711 μ-law (used by Twilio media streams) is unclear.\n\nWhat we’ve tried\n\nBeta API (worked fine):\n{\n“type”: “session.update”,\n“session”: {\n“input_audio_format”: “g711_ulaw”,\n“output_audio_format”: “g711_ulaw”\n}\n}\n\nGA API attempts (all rejected):\n\n 1. “session.input_audio_format” → Unknown parameter: ‘session.input_audio_format’\n 2. format: { type: “g711_ulaw” } → rejected\n\n\n\n{\n“type”: “session.update”,\n“session”: {\n“type”: “realtime”,\n“output_modalities”: [“text”, “audio”],\n“audio”: {\n“input”: {\n“format”: { “type”: “g711_ulaw” }\n},\n“output”: {\n“format”: { “type”: “g711_ulaw” },\n“voice”: “marin”\n}\n}\n}\n}\n\nQuestions\n\n 1. What are the valid values for session.audio.input.format.type in the GA API?\n 2. Is G.711 μ-law (8kHz) supported in gpt-realtime-2 over WebSocket, or only via SIP?\n 3. Is there an official migration guide from the beta to the GA session config schema?\n\n\n\nEnvironment\n\n * Model: gpt-realtime-2\n * Connection: WebSocket (wss://api.openai.com/v1/realtime)\n * Transport: Twilio media streams (G.711 μ-law, 8kHz)\n * No OpenAI-Beta header (GA API rejects it)\n\n\n\nAny help appreciated — the GA API docs don’t enumerate the valid audio format types for the nested object\nstructure.",
"title": "Gpt-realtime-2 GA API: What is the correct audio format for g711_ulaw (Twilio/telephony)?"
}