Skip to content
Back to skills

Didww To Xai

ASecurity

Point a DIDWW phone number at xAI's Grok voice over SIP. Use whenever the user wants Grok answering a real phone number via DIDWW, mentions sip.voice.x.ai, xAI realtime calls, registering a phone number with xAI, or debugging calls between DIDWW and Grok. Developer-grade: agent behavior is configured per call over a websocket the user's code owns.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 2, 2026
ai-agentsdebuggingapibackend

Works with

  • api
  • mcp

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned October 2, 2026

npx -y skills add didww/ai --skill didww-to-xai --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Didww To Xai?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Didww To Xai
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/didww-didww-to-xai/badge)](https://www.skillsdirectory.com/skills/didww-didww-to-xai)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: didww-to-xai
description: >
  Point a DIDWW phone number at xAI's Grok voice over SIP. Use whenever
  the user wants Grok answering a real phone number via DIDWW, mentions
  sip.voice.x.ai, xAI realtime calls, registering a phone number with
  xAI, or debugging calls between DIDWW and Grok. Developer-grade: agent
  behavior is configured per call over a websocket the user's code owns.
---

# DIDWW to xAI (Grok voice)

xAI's SIP interface mirrors OpenAI's shape with one improvement: the
number is REGISTERED with xAI first (an API object carrying its own SIP
auth), so ingress is gated by digest credentials or an IP allowlist
rather than webhook-only. Like OpenAI, there is no stored agent: on each
incoming call a webhook fires and your code connects a websocket to
configure voice, instructions and turn detection. Not a no-code path;
offer the hosted platforms if the user cannot run a small backend.

## The flow

1. **Confirm in one message:** number (or country to buy), agent
   behavior (becomes the per-call session config), transfer target,
   where the webhook backend runs.
2. **Register the number (`scripts/register_number.py`):**
   `POST https://api.x.ai/v2/phone-numbers` with `origin: "byo_trunk"`
   (the customer-owned-number type), the number, `webhook: {url}` for
   incoming-call events (an object, not a bare string) and `sip_auth`:
   digest credentials as `auth_username`/`auth_password` (preferred;
   invent a pair) and/or `allowed_addresses` with DIDWW's signaling
   IPs. The response carries the webhook signing secret exactly once
   and the SIP password is never returned again: store both
   immediately, the password in the DIDWW trunk, the secret in the
   backend's environment.
3. **DIDWW side (MCP, OAuth):** inbound trunk with destination
   `sip:{number}@sip.voice.x.ai;transport=tls`, digest auth from step 2.
   Attach the DID, set spend limits.
4. **Backend:** on the incoming-call webhook (carries `call_id`),
   connect `wss://api.x.ai/v1/realtime?call_id={call_id}` and send
   `session.update` with voice, instructions and turn detection. Call
   control: `POST /v1/realtime/calls/{call_id}/refer` with a `tel:`
   target for transfers, `/hangup` to end; DTMF arrives as
   `input_audio_buffer.dtmf_event_received` events. The OpenAI variant
   server in the didww-to-openai-realtime skill is the closest template;
   adapt its accept step to the websocket model.
5. **Verify:** inbound call, transfer phrase, hangup handling.

## Failure map

- Call never reaches xAI: TLS missing on the trunk, or digest pair
  mismatch with the registration object.
- Webhook fires but silence: the websocket connect or `session.update`
  failed; log both.
- Lost the SIP password: it is unreadable after creation; rotate by
  updating the registration and the DIDWW trunk together.
- Lost the webhook signing secret: also shown only at registration;
  re-register the number and update the backend's environment.
- 422 on registration: field names drifted; the API's error names the
  accepted fields (`auth_username`, `webhook.url`, ...), adjust and rerun.

## Panel map and money

xAI keys: `console.x.ai`, API Keys page. Billing: Billing, API spend
management: prepaid credits with a 25 USD minimum top-up and no free
credits documented; calls hard-fail the instant credits hit zero, so
configure auto top-up (threshold, amount, monthly cap) at setup. DIDWW
side: prepaid; top-up, Auto-charge and Low Balance Notification (OFF by
default) in Billing, Payment Methods.

---

Built around [DIDWW](https://www.didww.com/?ref=didww-to-xai) SIP
trunking and xAI's speech-to-speech SIP docs; verified August 2026.

Files in this skill

  • .npmignore66 B
  • LICENSE1.1 KB
  • README.md1.2 KB
  • SKILL.md3.6 KB
  • bin/install.js3.6 KB
  • install.sh1 KB
  • package.json790 B
  • publish.sh450 B
  • scripts/register_number.py2.4 KB
  • test.sh488 B
  • tests/test_register_number.py3.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.