OpenAI Realtime
Mint short-lived OpenAI Realtime session tokens so browsers and apps connect directly without ever seeing your API key.
This Module creates ephemeral keys for OpenAI's Realtime API (live, low-latency voice and transcription) through POST /v1/realtime/client_secrets. OpenAI removed the beta session endpoints on 12 May 2026; these Tasks use the released API. Your workflow hands the token to the client; the client then talks to OpenAI directly. Audio never flows through the platform, and the workspace API key never reaches the client.
How it works
- The Token reaches a Realtime Task; the Task asks OpenAI for an ephemeral session using the Environment's API key.
- The Task saves the session details, including a
client_secret(anek_…key) valid for Key valid for seconds (600 by default). - Your workflow returns the secret to the client (for example via an Output Task or an API response).
- The client uses the secret to open its own connection to the Realtime API and streams audio directly.
Configuration
Each OpenAI Module is configured separately, per Environment this Module has its own API key, so you can reuse the key you set on the core OpenAI Module or use a dedicated one (for example to track this capability's spend on its own).
| Field | Type | Required | Description |
|---|---|---|---|
| OpenAI API Key | string | Yes | Your OpenAI API key (sk-...) for this Module. Stored securely. Find it in OpenAI Console → API keys → Create new secret key. |
| OpenAI Organization | string | No | Your OpenAI organization ID (e.g. org-abc123), if your account belongs to one. |
Tasks
All Tasks in this Module are Generic (all Channels) they run the same regardless of how the Session was started.
Output fields: type a variable name without braces (for example session) and pick its type (string, number, true/false, object, date). The Task saves its result there, and any later Task can use it by writing {session}.
OpenAIRealtimeSessionTokenTask
Mints an ephemeral Realtime key. The client uses the returned client_secret.value to connect directly to the Realtime API before it expires.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| Model | string | Yes | gpt-realtime-2.1 | Realtime model: gpt-realtime-2.1 (default), gpt-realtime-2.1-mini, gpt-realtime-1.5. A retired gpt-4o-realtime-preview model runs on gpt-realtime-2.1 with a warning. |
| Voice | dropdown | No | marin | Voice for the assistant's audio: marin, cedar, alloy, ash, ballad, coral, echo, sage, shimmer, verse. Empty: the model's default. (fable, onyx and nova are not available on the Realtime API: a step that still names one uses the default voice, with a warning.) |
| Instructions | string | No | You are a friendly voice agent. | Optional system instructions for the realtime session. Supports {variable} placeholders. |
| Key valid for (seconds) | number | No | 600 | How long the client has to connect: 10 to 7200 seconds. Default 600. |
| Output Variable | object | Yes | session | Receives { id, model, client_secret: { value, expires_at } }. |
Example: Set Model = gpt-realtime-2.1, Voice = marin, Instructions = You are a friendly voice agent., Key valid for = 120, Output Variable = session. The Task saves the session entry to session; the client reads {session}'s client_secret.value and connects to OpenAI directly within two minutes.
OpenAIRealtimeTranscriptionSessionTask
Mints an ephemeral Realtime transcription key. Same client-direct pattern as OpenAIRealtimeSessionTokenTask, but for streaming transcription only.
| Property | Type | Required | Example | Description |
|---|---|---|---|---|
| Model | string | Yes | gpt-live-transcribe | Transcription model: gpt-live-transcribe (default) or gpt-transcribe. |
| Language | string | No | it | Optional ISO-639-1 code. Empty: detected automatically. |
| Key valid for (seconds) | number | No | 600 | 10 to 7200 seconds. Default 600. |
| Output Variable | object | Yes | session | Variable name (no braces). Receives the session entry with its client_secret. |
Example: Set Model = gpt-live-transcribe, Output Variable = session. The Task saves the transcription session entry to session; the client uses its client_secret.value to stream audio for live transcription.
Common recipes
Hand a browser a live voice session
When the user asks to talk, mint a fresh Realtime token and return the client_secret so the browser connects to OpenAI directly. Input and Output Tasks come from the Standard Module.
- InputTask Output Variable =
userMessage(the user asks to start a voice chat). - OpenAIRealtimeSessionTokenTask Model =
gpt-realtime-2.1, Voice =marin, Instructions =You are a friendly voice agent., Output Variable =session. - OutputTask Message =
{session}; the client extractsclient_secret.valueand opens its own Realtime connection before the key expires (10 minutes by default).
Best practices
- Keep the key short-lived: set Key valid for to just what the client needs to connect (a minute or two), and mint it as the last step before the client connects.
- Mint per connection request a fresh token for every client connection instead of reusing one.
The returned client_secret grants direct access to the Realtime API until it expires. Send it only to the client that will use it never log it or store it in long-lived Session data.
Error codes
| Code | Name | Description |
|---|---|---|
| 3005 | TaskInvalidData | A required property is missing or an output field is not a valid variable name details |
| 4001 | ModuleException | OpenAI rejected the session request or the call failed details |
| 4008 | ModuleMissingConfiguration | The OpenAI API key is not set in this Module's Environment configuration details |
| 4009 | ModuleInputEmpty | A required input resolved to an empty value at runtime details |
| 4022 | ModuleLogWarning | A retired model or voice was replaced details |
| 4012 | ModuleInvalidData | The Session data could not be read or OpenAI's response could not be processed details |
See the Error Code Reference for the full list.
Related pages
- OpenAI Module the family core chat, embeddings, and moderation Tasks.
- OpenAI Audio request/response text-to-speech and transcription when you don't need a live connection.