use-with-openai-realtime
Skill0 starsChanged 58 days agoMITView on GitHub
Point an OpenAI Realtime-compatible client at ThunderPhone. Use when someone asks for the ThunderPhone Realtime WebSocket URL, session.update events, saved agent_id versus inline config, endpoint swapping, server-side authentication, or migration from an OpenAI Realtime client.
- Reads credentials
- Sends data out
In this repository21 other files it gives its agents.
- AGENTS.mdAGENTS.md
- add-knowledgeSkill
- build-tool-integrationSkill
- create-agentSkill
- embed-web-widgetSkill
- get-phone-numberSkill
- handle-inbound-callsSkill
- iterate-on-agentSkill
- migrate-from-blandSkill
- migrate-from-elevenlabsSkill
- migrate-from-retellSkill
- migrate-from-vapiSkill
- place-outbound-callsSkill
- run-campaignSkill
- setup-api-keySkill
- setup-webhooksSkill
- test-agentSkill
- thunderphone-mcp-setupSkill
- thunderphone-prompt-builderSkill
- use-with-livekitSkill
- use-with-pipecatSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Authenticate server-side: Prefer Authorization: Bearer during the WebSocket handshake.
- Distinctive: line 25
Preserve event ordering: Wait for session confirmation before streaming audio.
- Distinctive: line 64
Verify the migration: Test connection, input audio, response audio, interruption/cancel, tools, language, error events, reconnect strategy, …
- Distinctive: line 80
Use the Realtime API reference and agents reference.
- Distinctive: line 81
Keep long-lived organization keys out of browsers, URLs, and client logs.
- Distinctive: line 82
Do not assume an extension outside the documented protocol is supported.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Use the OpenAI Realtime protocol
- Keep the protocol, change the endpoint. Connect the existing client to
wss://api.thunderphone.com/v1/realtime. ThunderPhone implements the OpenAI Realtime event model so the integration can keep its session, audio, and response event flow. - Authenticate server-side. Prefer
Authorization: Bearerduring the WebSocket handshake. Theapi_keyquery parameter exists for clients that cannot set headers, but it is easier to leak in URLs and logs; avoid it when headers are available. - Choose a configuration owner. Pass
agent_idfor a saved deployed agent, or send supported inline fields insession.update. Do not split ownership accidentally: a saved agent should remain the authority for its prompt, voice, tools, and knowledge. - Preserve event ordering. Wait for session confirmation before streaming audio; respect response lifecycle events; close and release buffers on every terminal path.
- Use REST session creation only when needed through
POST /v1/realtime/sessions.
{
"agent_id": 12
}curl --fail-with-body -X POST https://api.thunderphone.com/v1/realtime/sessions \
-H "Authorization: Bearer $THUNDERPHONE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-ThunderPhone-Client: skills/use-with-openai-realtime@1.0" \
--data-binary @realtime-session.jsonimport json, os, requests
with open("realtime-session.json", encoding="utf-8") as f: payload = json.load(f)
r = requests.post("https://api.thunderphone.com/v1/realtime/sessions", json=payload,
headers={"Authorization": f"Bearer {os.environ['THUNDERPHONE_API_KEY']}",
"X-ThunderPhone-Client": "skills/use-with-openai-realtime@1.0"}, timeout=30)
r.raise_for_status(); print(r.json())import { readFile } from "node:fs/promises";
const r = await fetch("https://api.thunderphone.com/v1/realtime/sessions", { method: "POST",
headers: { Authorization: `Bearer ${process.env.THUNDERPHONE_API_KEY}`,
"Content-Type": "application/json",
"X-ThunderPhone-Client": "skills/use-with-openai-realtime@1.0" },
body: await readFile("realtime-session.json", "utf8") });
if (!r.ok) throw new Error(await r.text()); console.log(await r.json());- Verify the migration. Test connection, input audio, response audio, interruption/cancel, tools, language, error events, reconnect strategy, and clean close. Compare payloads against the current ThunderPhone Realtime reference rather than assuming every vendor extension is portable.
Errors
| Symptom | Cause | Fix |
| WebSocket handshake is unauthorized | Bearer header is absent/invalid | Load THUNDERPHONE_API_KEY server-side and verify it through REST. |
| Key appears in proxy logs | Query-parameter authentication was used | Move auth to the handshake header and rotate an exposed key. |
| Session accepts events but behavior differs | Unsupported vendor extension or conflicting saved/inline settings | Reduce to documented events and select one configuration owner. |
| Audio continues after cancel | Client does not handle response lifecycle and buffer cleanup | Process cancel/completion events and stop playback immediately. |
Source and safety rules
- Use the Realtime API reference and agents reference.
- Keep long-lived organization keys out of browsers, URLs, and client logs.
- Do not assume an extension outside the documented protocol is supported.
- A successful handshake does not prove audio, interruption, latency, or tool behavior.
See references/realtime-migration.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

