Python 88.3%
TypeScript 7.6%
Shell 4.1%
1// STATUS: LIVE_VERIFIED 2026-09-18 (HTTP 200) — run: node --env-file=.env --experimental-strip-types examples/openai/realtime/client_secrets.ts2// Mint an ephemeral Realtime client secret from a trusted server. No SDK needed (plain fetch).3import { appendFileSync } from "node:fs";45const key = process.env.OPENAI_API_KEY;6if (!key) throw new Error("OPENAI_API_KEY missing (.env)");78const res = await fetch("https://api.openai.com/v1/realtime/client_secrets", {9 method: "POST",10 headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json", "OpenAI-Safety-Identifier": "atlas-example" },11 body: JSON.stringify({12 expires_after: { anchor: "created_at", seconds: 300 },13 session: { type: "realtime", model: "gpt-realtime-mini", output_modalities: ["text"], instructions: "Reply with OK." },14 }),15});16const data = await res.json();17appendFileSync("reports/live-requests.jsonl", JSON.stringify({ ts: new Date().toISOString(), provider: "openai", method: "POST",18 path: "/v1/realtime/client_secrets", status: res.status, est_cost_usd: 0, note: "example client_secrets.ts" }) + "\n");19console.log("HTTP", res.status, "secret:", typeof data.value === "string" ? data.value.slice(0, 3) + "***" : data,20 "session.type:", data.session?.type, "expires_at:", data.expires_at);21