Grok Voice Agent: Build One for $0.08/min (Setup Guide)

A Grok voice agent costs $0.08 a minute, no platform fee. Set one up in xAI’s no-code builder or the Realtime API, add SIP phone calls, LiveKit or Pipecat.

Last updated:

A Grok voice agent is a program that talks with people in real time using xAI's Grok Voice 3.0 model: it hears the caller, reasons, calls your tools or searches the web, and answers in one of the Grok voices, with sub-second latency and the ability to be interrupted. xAI says Starlink's call centers run this way (about 20,000 calls a day, roughly 70% resolved without a human), and the same API is open to anyone with a key.

Short answer:

  • What is it? A real-time voice assistant on xAI's Grok Voice 3.0 that can call your tools and search the web while it talks.
  • What does it cost? $0.08 per minute of session ($4.80 an hour), plus $0.004 per text input; no per-seat or platform fee.
  • How do I build one? Without code in the agent builder (console.x.ai → Voice → Agents), or with code over the Realtime WebSocket API.
  • Can it answer phone calls? Yes: a number you own at a carrier, routed to xAI over SIP, or a free number from xAI through the builder (beta).

This guide covers the pieces you need and the order to put them together. It is written from xAI's public documentation, last checked on 19 October 2026; the official voice docs are the source of truth for request shapes.

Grok voice agent at a glance

QuestionAnswer
Modelgrok-voice-3.0 (alias grok-voice-latest); grok-voice-2.0 is deprecated
Price$0.08 per minute of session ($4.80 per hour), plus $0.004 per text input
ConnectionRealtime WebSocket, wss://api.x.ai/v1/realtime, in the OpenAI Realtime event format
Voicesthe 28 built-in Grok voices or a custom cloned voice
Toolsweb_search, x_search, file_search, remote mcp servers and your own functions
Where users reach ityour server, a browser or mobile app (ephemeral token), or a phone number over SIP
Without codethe agent builder in xAI's console (console.x.ai → Voice → Agents)
FrameworksLiveKit and Pipecat

Free Grok voice agent tools

Three free tools on this site cover the parts people get stuck on. All of them run in your browser, and nothing you type is uploaded:

  • Prompt generator: writes the agent's instructions in the five-section shape xAI's prompting guide recommends, with escalation and safety rules.
  • Session builder: turns your voice, prompt, tools and audio format into a session.update event plus Python, Node.js or browser code, and warns about values outside xAI's limits.
  • Cost calculator: calls per day, minutes per call and tool use in; cost per call, per month and per year out.

What you are building

Every Grok voice agent is a Realtime session: a WebSocket connection to xAI carrying audio both ways. You configure the session with a model, a voice, instructions, and optionally tools. The model handles turn-taking, interruptions and speech on its own; your code only has to feed audio in, play audio out, and answer tool calls.

Three ways to connect a user to that session:

  1. Server to server: your backend opens the WebSocket with your API key. Good for phone bots and server-driven apps.
  2. Browser or mobile client: the client connects directly, but with a short-lived ephemeral client secret instead of your API key.
  3. Phone: a number you own at a carrier routes calls into the agent over SIP.

Step 1: pick the model and reasoning mode

Use "model": "grok-voice-latest" to always get the newest version (today that is grok-voice-3.0; grok-voice-2.0 still works but is deprecated). Set "reasoning": { "effort": "high" } (the default) for multi-step tasks, or "none" for simple flows where latency matters more than deliberation. The Grok Voice 3.0 session builder writes the whole session.update (voice, prompt, tools, audio format) with starter code in Python, Node.js or the browser.

Step 2: pick a voice

The voice is any built-in id (ara, eve, leo, rex, sal, altair, …, zenith) or a custom voice id. Since the agent and the text to speech endpoint share voices, the fastest way to choose is to type a few lines of your agent's script into the free text to speech tool and listen to candidates. For a support line, our suggested starting points are Altair (customer support, IVR), Iris (assistants, in-app guidance), Eve (the API's default voice) or Celeste (guided-tour style delivery); each voice page has samples you can play without an account.

Step 3 (browser clients): mint an ephemeral client secret

Never ship your API key to a browser. From your server:

curl -s https://api.x.ai/v1/realtime/client_secrets \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "expires_after": { "seconds": 300 },
    "session": { "model": "grok-voice-latest", "reasoning": { "effort": "high" } }
  }'

The response is { "value": "xai-realtime-client-secret-…", "expires_at": 1750000000 }. The client uses value as its Bearer token (or in the sec-websocket-protocol header with the xai-client-secret. prefix) to open the WebSocket. Secrets expire after at most 3600 seconds (default 600), and the session config you attach is applied when the connection opens, so the browser cannot change the model or instructions.

Step 4 (phone): bring your own number over SIP

xAI's API does not hand out phone numbers. Its SIP guide (read 19 October 2026) says provisioning numbers through the API is not supported, so the phone path is a number you already own at a carrier (Twilio, Telnyx, Plivo or any SIP provider), registered with xAI as a Direct SIP number:

curl -s https://api.x.ai/v2/phone-numbers \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "origin": "byo_trunk",
    "name": "Support line",
    "phone_number": "+18005550199",
    "webhook": { "url": "https://example.com/xai/sip-webhook" },
    "sip_auth": { "allowed_addresses": ["203.0.113.0/24"] }
  }'
  1. Point your carrier at xAI. Route the number's calls to sip:{number}@sip.voice.x.ai;transport=tls (the response's sip_host is sip.voice.x.ai). Secure the trunk with one method: allowed_addresses listing your carrier's SIP signaling CIDR ranges, or SIP digest credentials (auth_username and auth_password) set to the same values on the carrier side.
  2. Store the signing secret. The response's webhook.dispatch_signing_secret is shown once and cannot be recovered.
  3. Answer each call. xAI POSTs a signed realtime.call.incoming event to your webhook. Verify the webhook-id, webhook-timestamp and webhook-signature headers, read data.call_id, open wss://api.x.ai/v1/realtime?call_id={call_id} with your API key, then send session.update (voice, instructions, tools) and response.create. From there it is an ordinary Realtime session with the caller's audio bridged in.

The REST reference also lets a number route straight to an agent_id (an agent built in the console) instead of a webhook; the two are mutually exclusive. To stop answering, DELETE /v2/phone-numbers/{phone_number_id}; the number stays in your carrier account.

Where the docs disagree. xAI's REST reference (read 19 October 2026) still lists origin: "xai_provisioned" with an area_code filter, while the SIP guide says provisioning through the API is not supported and that deleting an xAI-provisioned number returns 403. This guide follows the SIP guide; check both pages before you build on xai_provisioned.

Step 5: give it tools

Tools are what turn a chatty model into an agent that resolves tickets. In the session config you declare functions (look up an order, reschedule a delivery, hand off to a human); when the model decides to call one, your code runs it and sends the result back as text. Each text input into the session is billed at $0.004, on top of the per-minute rate. Grok Voice 3.0's score on τ-Voice (71.6%, a benchmark for tool-using voice agents) is xAI's own measure of how reliably it does this. Name in the system prompt only the tools you actually pass; the Grok Voice 3.0 prompt generator writes the prompt in xAI's recommended shape and lists the tools to switch on.

Pricing summary

ItemPrice
Session time$0.08 per minute ($4.80 per hour)
Text inputs (instructions, tool results)$0.004 each
Speech to text, if you also transcribe recordings$0.10 per hour (REST), $0.20 per hour (streaming)

Put your call volume into the Grok Voice 3.0 cost calculator for a per-call and monthly figure, or use the pricing calculator for every Voice API price.

Grok voice agent with LiveKit, Pipecat and other frameworks

You do not have to write the WebSocket loop yourself. Support as of 19 October 2026, from each project's own docs:

PlatformGrok voice agent support
xAI Voice Agent APIgrok-voice-3.0 and grok-voice-latest, directly
LiveKitxai/grok-voice-3.0 in LiveKit Inference; the xAI plugin defaults to grok-voice-latest in Python
PipecatGrok Realtime service, default model grok-voice-latest (its docs still show grok-voice-think-fast-1.0 as a pin example)
Vercel AI Gatewaylists grok-voice-think-fast-1.0; no grok-voice-3.0 page yet
Twilio, Telnyx, any SIP providercarry phone calls to xAI over SIP (step 4); the agent itself still runs on xAI

LiveKit is worth it when you need WebRTC transport (patchy mobile networks), rooms with several people, or its own telephony stack. For a web demo or a phone line, connecting straight to xAI is the shorter path and adds no second bill.

Grok voice agent builder (no-code)

xAI's console has an agent builder (console.x.ai → Voice → Agents) where you set the voice, instructions and tools in a form and get an agent_id to attach to a phone number. Its product page (beta, read 19 October 2026) offers a free number from xAI or your own number over direct SIP; that free number comes through the builder, not the API call in step 4. It is the quickest way to get a working line before writing any WebSocket code.

Enterprise notes

From xAI's Voice API page: SOC 2 Type II, HIPAA eligibility with a BAA, GDPR data-processing agreements and EU residency options, zero data retention, custom concurrency limits, SAML SSO and audit logs. Contact xAI sales for those; this site is independent and cannot arrange them.

Questions