[ { "id": "7c28d6f5b81f4cf3", "type": "tab", "label": "Realtime Client Secret Example", "disabled": false, "info": "Realtime client-secret example.\n\nThis flow demonstrates the correct nested request contract for `createRealtimeClientSecret`:\n- client-secret options such as `expires_after` stay at the top level\n- Realtime session configuration lives under `session`\n- two inject nodes show the newer SDK-typed model ids `gpt-realtime-1.5` and `gpt-audio-1.5`", "env": [] }, { "id": "2b6f81da44f1b506", "type": "comment", "z": "7c28d6f5b81f4cf3", "name": "Configure the red-marked node, then run either inject node.", "info": "Before running:\n- import the flow, then configure the red-marked `OpenAI API` node with your own `Service Host`\n- this example stores request data in `msg.ai` because the `OpenAI API` node property is configured to `ai`\n- if your node uses the default property, the same shape belongs under `msg.payload`\n\nWhat this flow teaches:\n- `expires_after` remains top-level request metadata\n- Realtime session fields are nested under `session`\n- both `gpt-realtime-1.5` and `gpt-audio-1.5` pass through the existing adapter unchanged", "x": 430, "y": 140, "wires": [] }, { "id": "d48aabf237113ec2", "type": "comment", "z": "7c28d6f5b81f4cf3", "name": "What is a client secret?", "info": "A Realtime client secret is not your long-lived OpenAI API key.\n\nIt is a short-lived ephemeral token created server-side so a browser or mobile client can connect to the Realtime API without exposing the main API key.\n\nTypical flow:\n- your server or Node-RED flow creates the client secret\n- the returned `value` is passed to a trusted client application\n- that client uses the secret to open a Realtime session before it expires", "x": 430, "y": 200, "wires": [] }, { "id": "6e1099b8233f4f6f", "type": "inject", "z": "7c28d6f5b81f4cf3", "name": "Create Realtime 1.5 Client Secret", "props": [ { "p": "ai.expires_after.anchor", "v": "created_at", "vt": "str" }, { "p": "ai.expires_after.seconds", "v": "600", "vt": "num" }, { "p": "ai.session.type", "v": "realtime", "vt": "str" }, { "p": "ai.session.model", "v": "gpt-realtime-1.5", "vt": "str" }, { "p": "ai.session.output_modalities[0]", "v": "audio", "vt": "str" }, { "p": "ai.session.instructions", "v": "Speak clearly and keep responses concise.", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 300, "y": 260, "wires": [ [ "9df67f8a39c32558" ] ] }, { "id": "b7fce6b60f312e8a", "type": "inject", "z": "7c28d6f5b81f4cf3", "name": "Create Audio 1.5 Client Secret", "props": [ { "p": "ai.expires_after.anchor", "v": "created_at", "vt": "str" }, { "p": "ai.expires_after.seconds", "v": "600", "vt": "num" }, { "p": "ai.session.type", "v": "realtime", "vt": "str" }, { "p": "ai.session.model", "v": "gpt-audio-1.5", "vt": "str" }, { "p": "ai.session.output_modalities[0]", "v": "audio", "vt": "str" }, { "p": "ai.session.instructions", "v": "Generate short audio responses.", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "x": 290, "y": 340, "wires": [ [ "9df67f8a39c32558" ] ] }, { "id": "65c6ad57d8ef6d54", "type": "comment", "z": "7c28d6f5b81f4cf3", "name": "Expected result: debug sidebar shows value, expires_at, and session.", "info": "Successful responses from `createRealtimeClientSecret` return top-level `value`, `expires_at`, and `session` fields.\n\nWhat to inspect in the debug sidebar:\n- `session.type` should be `realtime`\n- `session.model` should match the inject node you sent\n- `value` is the ephemeral client secret to hand to a browser or mobile client", "x": 520, "y": 420, "wires": [] }, { "id": "9df67f8a39c32558", "type": "OpenAI API", "z": "7c28d6f5b81f4cf3", "name": "Create Realtime Client Secret", "property": "ai", "propertyType": "msg", "service": "", "method": "createRealtimeClientSecret", "x": 600, "y": 300, "wires": [ [ "86453bdf02676d9f" ] ] }, { "id": "86453bdf02676d9f", "type": "debug", "z": "7c28d6f5b81f4cf3", "name": "Realtime Client Secret", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 860, "y": 300, "wires": [] } ]