Pricing
| Pricing | Input Text | Input Audio | Input Text Cached | Input Audio Cached | Output Text | Output Audio |
|---|---|---|---|---|---|---|
Pricing | Input Text | Input Audio | Input Text Cached | Input Audio Cached | Output Text | Output Audio |
$0$0 | - | - | - | - | - | - |
Input Modalities
- Text
- Vision
- Audio
Output Modalities
- Text
- Audio
Context length
- 128K tokens
Max output
- 32K tokens
Capabilities
- Thinking
- Streaming
- Tool calling
- Web search
- URL context
- Code interpreter
- Computer use
- File search
- Memory tool
- Audio output
- Structured outputs
- Structured decision
- Citations
- Prompt caching
- Background mode
- Server-side sessions
Try this model
# pip install websockets
import asyncio
import base64
import json
import os
import websockets
# Realtime conversation is a WebSocket session: model must be in the handshake URL.
URL = "wss://aihubmix.com/v1/realtime?model=gpt-realtime-2.1"
async def main():
# websockets >= 13 uses additional_headers; older versions use extra_headers
async with websockets.connect(
URL, additional_headers={"Authorization": "Bearer " + os.environ["AIHUBMIX_API_KEY"]}
) as ws:
# 1) Configure the speech-to-speech session (voice + server VAD; no input transcription)
await ws.send(json.dumps({
"type": "session.update",
"session": {
"type": "realtime",
"audio": {
"input": {
"format": {
"type": "audio/pcm",
"rate": 24000
},
"turn_detection": {
"type": "server_vad"
}
},
"output": {
"format": {
"type": "audio/pcm",
"rate": 24000
},
"voice": "marin"
}
}
}
}))
# 2) Stream your mic as raw PCM16 / 24kHz / mono in ~100ms chunks. Server VAD
# detects when you stop talking and starts the reply automatically —
# no commit / response.create needed.
async def send_audio():
with open("audio_pcm16_24k.raw", "rb") as f:
pcm = f.read()
chunk = 24000 * 2 * 100 // 1000 # 100ms of 16-bit mono samples
for i in range(0, len(pcm), chunk):
await ws.send(json.dumps({
"type": "input_audio_buffer.append",
"audio": base64.b64encode(pcm[i:i + chunk]).decode(),
}))
await asyncio.sleep(0.1) # simulate realtime pacing
asyncio.create_task(send_audio())
# 3) Receive the reply: audio streams as base64 PCM16 (24kHz) — write it to a file you
# can play; the transcript of what the model says arrives as text deltas.
reply = open("assistant_reply_pcm16_24k.raw", "wb")
async for msg in ws:
evt = json.loads(msg)
etype = evt.get("type", "")
if etype == "input_audio_buffer.speech_started":
# Barge-in: you started talking — stop/flush local playback here
print("\n[listening…]")
elif etype.endswith("audio_transcript.delta"):
print(evt.get("delta", ""), end="", flush=True)
elif etype.endswith("audio.delta"):
reply.write(base64.b64decode(evt.get("delta", "")))
elif etype.endswith("response.done"):
print("\n[reply complete]")
elif etype == "error":
print("\n[error]", evt.get("error"))
break
reply.close()
asyncio.run(main())Frequently asked questions
What is the context length of GPT Realtime 2.1?
What modalities does GPT Realtime 2.1 support?
How do I call GPT Realtime 2.1 via API?
Who created GPT Realtime 2.1?
More models from OpenAI
See all OpenAI models →- Input: $ 10 /M
- Output: $ 50 /M
- Web Search: $0.01/request
GPT-6 Astra is OpenAI's newest and most intelligent model, with industry-leading performance in computer operations, web browsing, software engineering, scientific research, and professional work. It excels at executing multi-step workflows across code, browsers, and various professional software. Astra can achieve better results with significantly fewer output tokens, making its estimated API cost per task lower.
$0.017 per minute (same as OpenAI's official rate, no markup), charged by the audio duration transcribed in real time. Usage is settled to the second, rounded up to the next whole second.
OpenAI's latest realtime speech-to-text model, built for low-latency use — it streams incremental transcripts as audio arrives, ideal for live captions, dictation, and voice interfaces. Supports automatic transcription across 57 languages, with keyword/context hints and a tunable latency-vs-accuracy tradeoff.
Token-based pricing: Text input $5 / 1M tokens | Image input $8 / 1M tokens | Image output $30 / 1M tokens
GPT-Image-2.5 Flare is OpenAI's latest image model, the fastest and suited for everyday high-quality image generation. It accepts text and image inputs and produces image outputs. The model supports quality settings: low, medium, high, xhigh, max, and auto.
Token-based pricing: Text input $5 / 1M tokens | Image input $8 / 1M tokens | Image output $30 / 1M tokens
GPT Image 2.5 Sunburst is OpenAI's latest image model, capable of generating and editing images from text and image inputs. It is suitable for workflows that require extremely high editing precision. The model supports quality settings: low, medium, high, xhigh, max, and auto.
- Input: $ 4 /M
- Output: $ 20 /M
- Web Search: $0.01/request
GPT-5.6 Sol (limited-time 50% off) is OpenAI’s frontier reasoning model for complex coding, professional knowledge work, deep research, and long-running agents. It supports a roughly 1.05M-token context window, image understanding, and extensive tool use. Compared with Terra and Luna, Sol prioritizes capability and reliability on demanding tasks.
- Input: $ 0.2 /M
- Output: $ 1.2 /M
- Web Search: $0.01/request
GPT-5.6 Luna is designed for cost-sensitive, high-volume workloads. It roughly corresponds to the nano model tier used in earlier GPT-5 families.
© 2023 - 2026 AIHubMix, LLC