Skip to main content

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​

  1. The Token reaches a Realtime Task; the Task asks OpenAI for an ephemeral session using the Environment's API key.
  2. The Task saves the session details, including a client_secret (an ek_… key) valid for Key valid for seconds (600 by default).
  3. Your workflow returns the secret to the client (for example via an Output Task or an API response).
  4. 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).

FieldTypeRequiredDescription
OpenAI API KeystringYesYour OpenAI API key (sk-...) for this Module. Stored securely. Find it in OpenAI Console → API keys → Create new secret key.
OpenAI OrganizationstringNoYour 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.

PropertyTypeRequiredExampleDescription
ModelstringYesgpt-realtime-2.1Realtime 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.
VoicedropdownNomarinVoice 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.)
InstructionsstringNoYou are a friendly voice agent.Optional system instructions for the realtime session. Supports {variable} placeholders.
Key valid for (seconds)numberNo600How long the client has to connect: 10 to 7200 seconds. Default 600.
Output VariableobjectYessessionReceives { 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.

PropertyTypeRequiredExampleDescription
ModelstringYesgpt-live-transcribeTranscription model: gpt-live-transcribe (default) or gpt-transcribe.
LanguagestringNoitOptional ISO-639-1 code. Empty: detected automatically.
Key valid for (seconds)numberNo60010 to 7200 seconds. Default 600.
Output VariableobjectYessessionVariable 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.

  1. InputTask Output Variable = userMessage (the user asks to start a voice chat).
  2. OpenAIRealtimeSessionTokenTask Model = gpt-realtime-2.1, Voice = marin, Instructions = You are a friendly voice agent., Output Variable = session.
  3. OutputTask Message = {session}; the client extracts client_secret.value and opens its own Realtime connection before the key expires (10 minutes by default).

Best practices​

  1. 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.
  2. Mint per connection request a fresh token for every client connection instead of reusing one.
warning

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​

CodeNameDescription
3005TaskInvalidDataA required property is missing or an output field is not a valid variable name details
4001ModuleExceptionOpenAI rejected the session request or the call failed details
4008ModuleMissingConfigurationThe OpenAI API key is not set in this Module's Environment configuration details
4009ModuleInputEmptyA required input resolved to an empty value at runtime details
4022ModuleLogWarningA retired model or voice was replaced details
4012ModuleInvalidDataThe Session data could not be read or OpenAI's response could not be processed details

See the Error Code Reference for the full list.

  • 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.