[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EFQ0JRR71Q4R3FAZCMVKBQ":3,"skill-same:01M6EFQ0JRR71Q4R3FAZCMVKBQ":48},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":21,"linkOnly":22,"markdownContent":23,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M6EFQ0JRR71Q4R3FAZCMVKBQ","openai-realtime",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fopenai-realtime\u002FSKILL.md",[],[18,19,20],"realtime","openai","openai realtime","2026-11-10 10:12:30",false,"# OpenAI Realtime API — Voice-Native AI Conversations\n\n## Overview\n\nYou are an expert in the OpenAI Realtime API, the WebSocket-based interface for building voice-native AI applications. You help developers build conversational voice agents that process audio input directly (no separate STT step), generate spoken responses with natural intonation, handle interruptions, and use function calling — all in a single streaming connection with sub-second latency.\n\n## Instructions\n\n### WebSocket Connection\n\n```typescript\n\u002F\u002F Connect to OpenAI Realtime API\nimport WebSocket from \"ws\";\n\nconst ws = new WebSocket(\"wss:\u002F\u002Fapi.openai.com\u002Fv1\u002Frealtime?model=gpt-4o-realtime-preview\", {\n  headers: {\n    \"Authorization\": `Bearer ${process.env.OPENAI_API_KEY}`,\n    \"OpenAI-Beta\": \"realtime=v1\",\n  },\n});\n\nws.on(\"open\", () => {\n  \u002F\u002F Configure the session\n  ws.send(JSON.stringify({\n    type: \"session.update\",\n    session: {\n      modalities: [\"text\", \"audio\"],\n      voice: \"alloy\",                      \u002F\u002F alloy, echo, fable, onyx, nova, shimmer\n      instructions: `You are a helpful dental clinic receptionist named Ava.\n        Be warm, professional, and concise. Use short sentences appropriate for phone calls.\n        If asked about medical advice, say you'll transfer to the dentist.`,\n      input_audio_format: \"pcm16\",         \u002F\u002F 16-bit PCM, 24kHz\n      output_audio_format: \"pcm16\",\n      input_audio_transcription: {\n        model: \"whisper-1\",                 \u002F\u002F Also transcribe for logging\n      },\n      turn_detection: {\n        type: \"server_vad\",                 \u002F\u002F Server-side voice activity detection\n        threshold: 0.5,                     \u002F\u002F Sensitivity (0-1)\n        prefix_padding_ms: 300,             \u002F\u002F Include 300ms before speech start\n        silence_duration_ms: 500,           \u002F\u002F 500ms silence = end of turn\n      },\n      tools: [                              \u002F\u002F Function calling tools\n        {\n          type: \"function\",\n          name: \"check_availability\",\n          description: \"Check available appointment slots\",\n          parameters: {\n            type: \"object\",\n            properties: {\n              date: { type: \"string\", description: \"Date in YYYY-MM-DD format\" },\n              procedure: { type: \"string\", enum: [\"cleaning\", \"filling\", \"crown\", \"consultation\"] },\n            },\n            required: [\"date\", \"procedure\"],\n          },\n        },\n        {\n          type: \"function\",\n          name: \"book_appointment\",\n          description: \"Book an appointment for a patient\",\n          parameters: {\n            type: \"object\",\n            properties: {\n              patient_name: { type: \"string\" },\n              phone: { type: \"string\" },\n              date: { type: \"string\" },\n              time: { type: \"string\" },\n              procedure: { type: \"string\" },\n            },\n            required: [\"patient_name\", \"date\", \"time\", \"procedure\"],\n          },\n        },\n      ],\n    },\n  }));\n});\n\n\u002F\u002F Handle events from OpenAI\nws.on(\"message\", (data) => {\n  const event = JSON.parse(data.toString());\n\n  switch (event.type) {\n    case \"response.audio.delta\":\n      \u002F\u002F Stream audio chunks to speaker\u002FWebRTC\n      const audioChunk = Buffer.from(event.delta, \"base64\");\n      sendToSpeaker(audioChunk);\n      break;\n\n    case \"response.audio_transcript.delta\":\n      \u002F\u002F Real-time transcript of AI's response\n      process.stdout.write(event.delta);\n      break;\n\n    case \"conversation.item.input_audio_transcription.completed\":\n      \u002F\u002F User's speech transcribed\n      console.log(`\\nUser said: ${event.transcript}`);\n      break;\n\n    case \"response.function_call_arguments.done\":\n      \u002F\u002F AI wants to call a function\n      handleFunctionCall(event.name, JSON.parse(event.arguments));\n      break;\n\n    case \"input_audio_buffer.speech_started\":\n      \u002F\u002F User started speaking — interrupt AI if it's talking\n      console.log(\"[User interruption detected]\");\n      break;\n  }\n});\n\n\u002F\u002F Send microphone audio\nfunction sendAudio(pcmBuffer: Buffer) {\n  ws.send(JSON.stringify({\n    type: \"input_audio_buffer.append\",\n    audio: pcmBuffer.toString(\"base64\"),\n  }));\n}\n\n\u002F\u002F Handle function calls\nasync function handleFunctionCall(name: string, args: any) {\n  let result: string;\n\n  if (name === \"check_availability\") {\n    const slots = await checkClinicSlots(args.date, args.procedure);\n    result = JSON.stringify(slots);\n  } else if (name === \"book_appointment\") {\n    const booking = await createAppointment(args);\n    result = JSON.stringify(booking);\n  }\n\n  \u002F\u002F Send function result back — AI will speak the response\n  ws.send(JSON.stringify({\n    type: \"conversation.item.create\",\n    item: {\n      type: \"function_call_output\",\n      call_id: event.call_id,\n      output: result,\n    },\n  }));\n\n  \u002F\u002F Trigger AI to respond with the function result\n  ws.send(JSON.stringify({ type: \"response.create\" }));\n}\n```\n\n### Python SDK\n\n```python\n# Using OpenAI Python SDK\nfrom openai import AsyncOpenAI\n\nclient = AsyncOpenAI()\n\nasync def run_voice_agent():\n    async with client.beta.realtime.connect(\n        model=\"gpt-4o-realtime-preview\"\n    ) as connection:\n        await connection.session.update(session={\n            \"modalities\": [\"text\", \"audio\"],\n            \"voice\": \"nova\",\n            \"instructions\": \"You are a helpful assistant.\",\n            \"turn_detection\": {\"type\": \"server_vad\"},\n        })\n\n        # Send audio from microphone\n        await connection.input_audio_buffer.append(audio=base64_audio)\n\n        # Process events\n        async for event in connection:\n            if event.type == \"response.audio.delta\":\n                play_audio(event.delta)\n            elif event.type == \"response.done\":\n                print(\"AI finished speaking\")\n```\n\n## Key Concepts\n\n- **Audio-native** — The model processes audio directly, understanding tone, emotion, and emphasis (not just text transcription)\n- **Server VAD** — OpenAI's server detects when the user starts\u002Fstops speaking; no client-side VAD needed\n- **Interruptions** — When the user speaks while AI is talking, the response is automatically interrupted\n- **Function calling** — Same as Chat Completions function calling, but in real-time during voice conversation\n\n## Examples\n\n**Example 1: User asks to set up openai-realtime**\n\nUser: \"Help me set up openai-realtime for my project\"\n\nThe agent should:\n1. Check system requirements and prerequisites\n2. Install or configure openai-realtime\n3. Set up initial project structure\n4. Verify the setup works correctly\n\n**Example 2: User asks to build a feature with openai-realtime**\n\nUser: \"Create a dashboard using openai-realtime\"\n\nThe agent should:\n1. Scaffold the component or configuration\n2. Connect to the appropriate data source\n3. Implement the requested feature\n4. Test and validate the output\n\n## Guidelines\n\n1. **Server VAD for simplicity** — Use `server_vad` turn detection; OpenAI handles speech detection, silence, and interruptions\n2. **PCM16 format** — Use 16-bit PCM at 24kHz for both input and output; minimal encoding overhead\n3. **Short instructions** — Keep system instructions concise; the model processes them with every turn\n4. **Function calls for actions** — Use tools for bookings, lookups, and transfers; the model speaks the result naturally\n5. **Input transcription** — Enable `input_audio_transcription` for logging and analytics; small additional cost\n6. **Silence threshold tuning** — 500ms silence_duration for responsive agents; 1000ms for dictation (avoids mid-sentence cuts)\n7. **Voice selection** — `nova` for friendly female, `onyx` for authoritative male, `alloy` for neutral; test with your use case\n8. **Cost awareness** — Realtime API costs ~$0.06\u002Fmin input + $0.24\u002Fmin output audio; use for high-value interactions (sales, support), not bulk processing\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fopenai-realtime",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill openai-realtime",{"tool":40,"command":41},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill openai-realtime",{"tool":43,"command":44},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill openai-realtime","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fopenai-realtime\u002FSKILL.md",true,[],[49,58,67,76,82,88],{"skillNo":50,"name":51,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":21},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[55,56,57],"model","model hierarchy","model hierarchy skill",{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":21},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[64,65,66],"MCP","zoom","zoom mcp",{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":21},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[73,74,75,65],"sdk","zoom apps sdk","apps",{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":21},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[78],{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":21},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[84],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":21},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[90]]