Realtime transparently relays native events from the selected model over WebSocket; the gateway does not normalize events into a single Realtime schema.
https://api.tokensmarket.ai/v1GET /realtime?model={model}The endpoint remains fixed. Use the parameter documentation on this page to replace the model ID and request data.
${base_url}/realtime?model={model}Provide model in the WebSocket handshake URL and authenticate with a Bearer API Key.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | — | Exact model IDs for Realtime are currently supported. |
Authorization | string | Yes | — | Bearer API Key for WebSocket handshake. |
Exchange text WebSocket frames after the upgrade. Event types, audio encoding, voices, turn detection, and tool capabilities are defined by the selected model and Model Market; clients handle native events directly.
The examples use placeholders. Replace them with a currently available model ID from the model details page, and keep your API Key in a server-side environment variable.
import asyncio, os, websockets
async def main():
uri = "wss://api.tokensmarket.ai/v1/realtime?model=<MODEL_ID>"
async with websockets.connect(uri, additional_headers={"Authorization": f"Bearer {os.environ['TOKEN_MARKET_API_KEY']}"}) as ws:
async for event in ws:
print(event)
asyncio.run(main())