# xAI Grok Voice API

> Grok Voice listens to a recording of a user's speech and replies as a Grok voice agent with spoken audio and its transcript. Optional instructions set the agent's persona, and 28 built-in xAI voices are available.

Source: https://www.sandbase.ai/models/xai/grok-voice
API reference: https://www.sandbase.ai/models/xai/grok-voice#api

## Facts

- Provider: xAI
- Type: Audio model
- Model ID: `xai/grok-voice`
- Price: From $0.02 per run
- Capabilities: audio to audio, audio to text
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "xai/grok-voice",
  "audio": "https://v3b.fal.media/files/b/0a8dd5a2/hS140ygvRuxn-eY_qPhlv_assets_test_input_service.wav",
  "prompt": "You are a friendly assistant. Answer briefly and concretely."
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## FAQ

### How do I call xAI Grok Voice through SandBase?

Create a SandBase API key, then send requests with the model ID "xai/grok-voice" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### Do I need a separate xAI account?

No. One SandBase API key and balance gives you access to xAI Grok Voice and the other models in the catalog; you do not need to sign up with xAI separately.

## README

### Grok Voice

Grok Voice turns a spoken question (up to 10 minutes) into a spoken Grok reply plus its transcript, with 28 built-in voices.

#### Fields

| Field | Type | Default | Notes |
|---|---|---|---|
| `audio` | audio file or URL, required | — | User speech, up to 10 minutes and 50 MB. |
| `prompt` | string | — | Persona and context for the agent; omit for Grok's default. |
| `voice` | string | — | Reply voice; omit for Grok's default. See the schema for supported values. |

#### Output

| Field | Notes |
|---|---|
| `url` | Spoken reply (WAV, 24 kHz mono). |
| `content_type` | MIME type of the reply. |
| `text` | Transcript of the reply (empty when not provided). |
| `duration` | Reply length in seconds. |

#### Billing

$0.00083 per second of the spoken reply (about $0.05 per minute), using the measured reply length. The quote before submission assumes a 30-second reply.

| Reply | Price |
|---|---|
| 10 s | $0.0083 |
| 30 s | $0.0249 |
| 60 s | $0.0498 |

Failed runs are not charged.

#### Prompting

- Keep the persona short and say how long answers should be.

#### Also on SandBase

Related: `xai/grok-tts`.
