[LIVE] [GoodHand-Off/realtime-voice-guard] 3 endpoint(s)
ChatGPT
API Proxy/ChatGPT
2,271 characters
Status: [LIVE]
Endpoints found:
https://developers.openai.com/api/docs/models/gpt
https://developers.openai.com/api/docs/pricing
https://developers.openai.com/api/docs/guides/voice-latency-cost?api=realtime
Source: https://github.com/GoodHand-Off/realtime-voice-guard
# realtime-voice-guard: time and spend limits for OpenAI Realtime API calls
**Stop an OpenAI Realtime API call from running up your bill.** A small Node service that sits between your app and the OpenAI Realtime API, gives every call its own time limit and spend limit, and hangs up on OpenAI's side when either one is reached. Your OpenAI key never leaves the server.
A browser tab left open next to a TV can keep a Realtime session talking for up to OpenAI's 60-minute session limit. Under the assumptions below, that one call costs about $5 on `gpt-realtime-2.1` if prompt caching works, and about $158 if it doesn't. With the guard's default caps it ends at 10 minutes, and every response reserves the most it can cost, so the call hangs up while one more response would still fit. Through the WebSocket relay that keeps estimated spend at or under $1. In WebRTC mode the browser talks to OpenAI directly and can add to that; [The bound](#the-bound) says exactly what each mode covers.
## Quick start
Needs Node 22.12 or newer and an OpenAI API key with Realtime access ([create one](https://platform.openai.com/api-keys)).
```bash
git clone https://github.com/GoodHand-Off/realtime-voice-guard && cd realtime-voice-guard && npm ci && npm run build
OPENAI_API_KEY=sk-your-key npm run setup # writes .env with your key and two fresh random secrets
npm start # listens on http://localhost:8080
```
`npm run setup` never overwrites an existing `.env`; run it without the key if you'd rather paste the key into `.env` yourself. The guard reads `.env` from the folder it starts in, and real environment variables win over it. It keeps those values to itself: they never enter `process.env`, and the keys stay out of logs and serialized config. A missing or invalid setting stops it at startup with a message that names the variable and says where to get a value.
Then make a real call from your browser: run `node examples/browser/server.mjs` in a second term