hello-realtimeREADME.md7 matches
5[hello-realtime.val.run](https://hello-realtime.val.run), or via SIP by calling 425-800-0042.
67This demo shows off the new SIP API, the new all-in-one WebRTC API, and the new
8server-side websocket interface.
910If you remix the app, you'll just need to pop in your own `OPENAI_API_KEY` (from
11[platform.openai.com](https://platform.openai.com)), and if you want SIP, the `OPENAI_SIGNING_SECRET`.
1223- observer established to monitor session
2425## API Endpoints
26- `GET /` - serves the WebRTC-based app
27- `POST /rtc` - creates a new WebRTC-based Realtime API session
28- `POST /sip` - handles an incoming Realtime API SIP call
29- `POST /observer` - internal endpoint to establish a Realtime API websocket for session control
3031## Project Structure
39|ββ rtc.ts # WebRTC session setup
40|ββ sip.ts # SIP webhook handling and session setup
41βββ utils.ts # Realtime API session configuration and helpers
42```
43
hello-realtimeobserver.ts1 match
8observer.post("/:callId", async (c) => {
9const callId = c.req.param("callId");
10const url = `wss://api.openai.com/v1/realtime?call_id=${callId}`;
11const ws = new WebSocket(url, { headers: makeHeaders() });
12ws.on("open", () => {
hello-realtimeindex.html1 match
4<meta charset="utf-8" />
5<meta name="viewport" content="width=device-width, initial-scale=1" />
6<title>OpenAI Realtime API Voice Agent</title>
7<style>
8:root {
72<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
73<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script>
74<link rel="preconnect" href="https://fonts.googleapis.com">
75<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
76<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
77<script>
78function onOpenCvReady() {
325}
326};
327const API_URL = '${sourceUrl}';
328329// --- UTILITIES ---
475analysisCanvas.getContext('2d').drawImage(App.image.img, 0, 0, width, height);
476const imageDataUrl = analysisCanvas.toDataURL('image/jpeg', 0.9);
477const response = await fetch(API_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ image: imageDataUrl }) });
478if (!response.ok) { throw new Error((await response.json()).error || 'AI analysis failed.'); }
479const result = await response.json();
72<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
73<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script>
74<link rel="preconnect" href="https://fonts.googleapis.com">
75<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
76<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
77<script>
78function onOpenCvReady() {
325}
326};
327const API_URL = '${sourceUrl}';
328329// --- UTILITIES ---
475analysisCanvas.getContext('2d').drawImage(App.image.img, 0, 0, width, height);
476const imageDataUrl = analysisCanvas.toDataURL('image/jpeg', 0.9);
477const response = await fetch(API_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ image: imageDataUrl }) });
478if (!response.ok) { throw new Error((await response.json()).error || 'AI analysis failed.'); }
479const result = await response.json();
10
11// Connect to OpenAI WebSocket for this call
12const wsUrl = `wss://api.openai.com/v1/realtime?call_id=${callId}`;
13const ws = new WebSocket(wsUrl, {
14headers: makeHeaders(),
hello-transcriptionREADME.md7 matches
1# hello-transcription
23Real-time speech transcription using OpenAI's Realtime API - a demonstration of transcription-only mode without AI responses.
45## Features
14## How It Works
1516This app uses OpenAI's Realtime API in transcription-only mode:
171. Your voice is captured via WebRTC
182. Audio is streamed to OpenAI's transcription service
426. Click "Stop" to end the session
4344## API Endpoints
4546- `GET /` - Serves the transcription interface
5152Set in your Val Town environment:
53- `OPENAI_API_KEY` - Your OpenAI API key (required)
5455## Local Development
66671. Fork/remix this val on Val Town
682. Add your `OPENAI_API_KEY` to Val Town secrets
693. Your app will be available at `https://[your-val-name].val.run`
7071## Technical Details
7273The app uses OpenAI's Realtime API in transcription mode:
74- Session type: `transcription` (not `realtime`)
75- Audio format: PCM16
85## Credits
8687Built with OpenAI's Realtime API for transcription-only use cases.
hello-transcriptionCLAUDE.md13 matches
1# Hello-Transcription - OpenAI Realtime API Transcription Demo
23## π― Project Overview
45Hello-Transcription demonstrates the transcription-only mode of OpenAI's Realtime API. Unlike the conversational mode, this implementation focuses purely on speech-to-text conversion without generating AI responses, making it ideal for subtitles, live captions, meeting transcriptions, and other transcription-focused use cases.
67**Created:** September 2, 2025
8**Platform:** Val Town
9**API:** OpenAI Realtime API (Transcription Mode)
10**Key Feature:** Real-time streaming transcription with multiple model support
1114- **Runtime:** Deno (Val Town platform)
15- **Framework:** Hono (lightweight web framework)
16- **Transcription:** OpenAI Realtime API in transcription mode
17- **Connection:** WebRTC with data channel for events
18- **Frontend:** Vanilla JavaScript with split-view interface
39### Transcription vs Conversation Mode
4041The Realtime API supports two distinct modes:
42431. **Conversation Mode** (`type: "realtime"`):
299```bash
300# Create .env file
301echo "OPENAI_API_KEY=sk-..." > .env
302
303# Install Deno
347**Solutions:**
348- Check microphone permissions
349- Verify OPENAI_API_KEY is set
350- Check browser console for errors
351- Ensure WebRTC connection established
391392### Current Implementation
393- API key stored in environment variable
394- No authentication on endpoints
395- No rate limiting
4144152. **Set Environment**
416- Add `OPENAI_API_KEY` in Val Town secrets
4174183. **Deploy**
425426### Environment Variables
427- `OPENAI_API_KEY` - Required for OpenAI API access
428429## π Future Enhancements
4586. **Integration**
459- Webhook support
460- Real-time API streaming
461- Database storage
462465### Documentation
466- [OpenAI Realtime Transcription Guide](https://platform.openai.com/docs/guides/realtime-transcription)
467- [Realtime API Reference](https://platform.openai.com/docs/api-reference/realtime)
468- [Voice Activity Detection Guide](https://platform.openai.com/docs/guides/realtime-vad)
469- [Val Town Documentation](https://docs.val.town)
498## π― Summary
499500Hello-Transcription successfully demonstrates the transcription-only capabilities of OpenAI's Realtime API. Key achievements:
5015021. **Pure Transcription**: No AI responses, focused solely on speech-to-text
3const SLACK_TOKEN = Deno.env.get("SLACK_BOT_TOKEN");
4const CHANNEL_ID = "C1234567890"; // μ€μ μ±λ ID
5const HOLIDAY_API_KEY = Deno.env.get("HOLIDAY_API_KEY"); // 곡곡λ°μ΄ν°ν¬νΈ μΈμ¦ν€
67function formatDateKey(date) {
18async function getHolidays(year) {
19const url =
20`https://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getHoliDeInfo?serviceKey=${HOLIDAY_API_KEY}&solYear=${year}&numOfRows=100&_type=json`;
21const res = await fetch(url);
22const json = await res.json();
75`;
7677await fetch("https://slack.com/api/chat.postMessage", {
78method: "POST",
79headers: {