OpenAI
gpt-realtime-2.1-mini API pricing and integration
Integrate gpt-realtime-2.1-mini using the published protocols below. Review context limits and billing units before choosing request parameters.
Model ID: gpt-realtime-2.1-mini · Catalog updated: 2026-11-04
Published base prices
Text input
$0.60/ 1M tokens
Audio input
$10.00/ 1M tokens
Image input
$0.80/ 1M tokens
Text output
$2.40/ 1M tokens
Audio output
$20.00/ 1M tokens
Account discounts and final billing are shown in your dashboard.
Model parameters and protocols
- Context window
- 128,000 tokens
- Maximum output
- 32,000 tokens
- Billing type
- composite
- Published protocols
- /v1/realtime
Parameters and tool support
A listed protocol does not imply support for every parameter or hosted tool. Image input, reasoning options, structured output, and tool execution depend on the model and route. Validate your workload with a small request and preserve session context for tool continuations.
Tools and sessions guideIntegration examples
Complete examples
Generated from the model’s public capabilities and updated with every selection.
Supported protocols only
Realtime · VoicePythonDefault provider
Realtime · Voice · Python
import asyncio, base64, json, os
from websockets.asyncio.client import connect
async def main():
headers = {"Authorization": "Bearer " + os.environ["GR_API_KEY"]}
async with connect("wss://endpoint.greatrouter.com/v1/realtime?model=gpt-realtime-2.1-mini", additional_headers=headers) as ws:
async def send(event):
await ws.send(json.dumps(event))
async for raw in ws:
event = json.loads(raw)
if event["type"] == "session.created":
await ws.send("{\"type\":\"session.update\",\"session\":{\"type\":\"realtime\",\"output_modalities\":[\"text\"]}}")
elif event["type"] == "session.updated":
await send({"type": "conversation.item.create", "item": {"type": "message", "role": "user", "content": [{"type": "input_text", "text": "Say hello."}]}})
await send({"type": "response.create"})
if event["type"] == "error":
raise RuntimeError(event["error"].get("message", "Realtime error"))
print(event)
if event["type"] == "response.done":
break
asyncio.run(main())