examples/realtime/twilio_sip/README.md
This example shows how to handle OpenAI Realtime SIP calls with the Agents SDK. Incoming calls are accepted through the Realtime Calls API, a triage agent answers with a fixed greeting, and handoffs route the caller to specialist agents (FAQ lookup and record updates) similar to the realtime UI demo.
https://<your-public-host>/openai/webhook with "realtime.call.incoming" event type and note the signing secret. The example verifies each webhook with OPENAI_WEBHOOK_SECRET.sip:proj_<your_project_id>@sip.api.openai.com;transport=tls so Twilio sends inbound calls to OpenAI. (The Termination tab always ends with .pstn.twilio.com, so leave it unchanged.)uv pip install -r examples/realtime/twilio_sip/requirements.txt
export OPENAI_API_KEY="sk-..."
export OPENAI_WEBHOOK_SECRET="whsec_..."
examples/realtime/twilio_sip/agents.py if you want
to change the specialist agents or tools.uv run uvicorn examples.realtime.twilio_sip.server:app --host 0.0.0.0 --port 8000
ngrok http 8000
sip.api.openai.com; OpenAI fires realtime.call.incoming, which this example accepts.faq_lookup_tool.update_customer_record.You can edit server.py to change instructions, add tools, or integrate with internal systems once the SIP session is active.