> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unifically.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Grok Speech to Text

> Transcribe audio with xAI Grok, with optional speaker diarization and word timestamps. See parameters, pricing, and API examples.

Transcribe an audio file by URL using xAI's Grok speech-to-text model. Returns the transcript text, the detected language, the audio duration, and per-word timing, with optional speaker labels.

## Model

```
xai/grok-stt
```

## Pricing

| Unit | Price |
| - | - |
| Per hour of audio | \$0.05 |

Billed per started hour: a 5-minute file and a 59-minute file each cost $0.05; a 61-minute file costs $0.10.

## Parameters

| Parameter | Type | Required | Default | Description |
| - | - | - | - | - |
| `audio_url` | string | Yes | — | Public URL of the audio file to transcribe. Supported: mp3, wav, ogg, opus, flac, aac, mp4, m4a, mkv |
| `language` | string | No | — | Language code hint (for example `en`, `fr`, `de`). Omit to auto-detect |
| `diarize` | boolean | No | `false` | Label each word with the detected speaker |

<Note>
  `audio_url` must be publicly reachable; a URL that cannot be fetched is rejected with a `422` before the task starts.
</Note>

## Example Request

```bash theme={null}
curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "xai/grok-stt",
    "input": {
      "audio_url": "https://example.com/interview.mp3",
      "diarize": true
    }
  }'
```

## Response

```json theme={null}
{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "abc123def456",
    "status": "processing"
  }
}
```

## Completed Response

Poll `GET /v1/tasks/{task_id}` until `status` is `completed`:

```json theme={null}
{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "abc123def456",
    "status": "completed",
    "output": {
      "text": "Thanks for joining us today. Let's get started.",
      "language": "en",
      "duration": 4.8,
      "words": [
        { "word": "Thanks", "start": 0.0, "end": 0.42 },
        { "word": "for", "start": 0.42, "end": 0.55 }
      ]
    }
  }
}
```

| Field | Type | Description |
| - | - | - |
| `text` | string | Full transcript |
| `language` | string | Detected (or supplied) language code |
| `duration` | number | Length of the audio in seconds |
| `words` | array | Per-word timing. With `diarize: true`, each word also carries its speaker label |

<Note>
  **Volume discounts** are available for almost all models. Reach out at [contact@unifically.com](mailto:contact@unifically.com) to discuss custom pricing.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.