agentleFS
thunderphonethunderphone/skills/use-with-openai-realtime/SKILL.md

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

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
  1. Very specific:

    Authenticate server-side: Prefer Authorization: Bearer during the WebSocket handshake.

    line 17
  2. Distinctive:

    Preserve event ordering: Wait for session confirmation before streaming audio.

    line 25
  3. Distinctive:

    Verify the migration: Test connection, input audio, response audio, interruption/cancel, tools, language, error events, reconnect strategy, …

    line 64
  4. Distinctive:

    Use the Realtime API reference and agents reference.

    line 80
  5. Distinctive:

    Keep long-lived organization keys out of browsers, URLs, and client logs.

    line 81
  6. Distinctive:

    Do not assume an extension outside the documented protocol is supported.

    line 82

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Use the OpenAI Realtime protocol

  1. 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.
  2. Authenticate server-side. Prefer Authorization: Bearer during the WebSocket handshake. The api_key query parameter exists for clients that cannot set headers, but it is easier to leak in URLs and logs; avoid it when headers are available.
  3. Choose a configuration owner. Pass agent_id for a saved deployed agent, or send supported inline fields in session.update. Do not split ownership accidentally: a saved agent should remain the authority for its prompt, voice, tools, and knowledge.
  4. Preserve event ordering. Wait for session confirmation before streaming audio; respect response lifecycle events; close and release buffers on every terminal path.
  5. 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.json
import 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());
  1. 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

SymptomCauseFix
WebSocket handshake is unauthorizedBearer header is absent/invalidLoad THUNDERPHONE_API_KEY server-side and verify it through REST.
Key appears in proxy logsQuery-parameter authentication was usedMove auth to the handshake header and rotate an exposed key.
Session accepts events but behavior differsUnsupported vendor extension or conflicting saved/inline settingsReduce to documented events and select one configuration owner.
Audio continues after cancelClient does not handle response lifecycle and buffer cleanupProcess 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.