gpt-realtime-2.1
model id: openai/gpt-realtime-2.1/{host_id}
Audio in → Audio out
Hosts
Don’t know how to select a host? Check Provider selection.
0% additional markup beyond our 2% platform fee.
import asyncio, json, websockets
async def main():
async with websockets.connect(
"wss://videorouter.sh/v1/realtime?model=gpt-realtime-2.1",
additional_headers={"Authorization": "Bearer llmr_sk_..."},
) as ws:
print(json.loads(await ws.recv())) # -> {"type": "session.created", ...}
await ws.send(json.dumps({"type": "session.update",
"session": {"type": "realtime", "instructions": "You are a helpful assistant."}}))
# ... input_audio_buffer.append chunks, then response.create ...
await ws.send(json.dumps({"type": "response.create"}))
print(json.loads(await ws.recv())) # -> response.* stream, ending in response.done + usage
asyncio.run(main())