> ## 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.

# Speech-to-Text

> Transcribe audio to text with ElevenLabs

Transcribe audio files to text using ElevenLabs Scribe v2 with word-level timestamps, speaker diarization, and entity detection.

## Model

```
elevenlabs/speech-to-text
```

## Parameters

| Parameter                | Type         | Required | Default     | Description                                                                                           |
| ------------------------ | ------------ | -------- | ----------- | ----------------------------------------------------------------------------------------------------- |
| `audio_url`              | string       | Yes      | -           | URL of the audio file to transcribe                                                                   |
| `language_code`          | string       | No       | auto-detect | ISO 639-1/639-3 language code                                                                         |
| `diarize`                | boolean      | No       | `false`     | Identify who is speaking (speaker diarization)                                                        |
| `num_speakers`           | integer      | No       | auto        | Max number of speakers (up to 32)                                                                     |
| `diarization_threshold`  | number       | No       | `0.22`      | Higher = fewer speakers, lower = more. Only used when `diarize` is true and `num_speakers` is not set |
| `timestamps_granularity` | string       | No       | `word`      | `"none"`, `"word"`, or `"character"`                                                                  |
| `tag_audio_events`       | boolean      | No       | `true`      | Tag events like (laughter), (music), (footsteps)                                                      |
| `entity_detection`       | string/array | No       | -           | Detect entities: `"all"`, or specific types like `"pii"`, `"phi"`, `"pci"`, `"offensive_language"`    |
| `temperature`            | number       | No       | `0`         | Randomness (0–2). Higher = more diverse output                                                        |
| `seed`                   | integer      | No       | -           | Seed for deterministic results (0–2147483647)                                                         |
| `keyterms`               | array        | No       | -           | Words/phrases to boost recognition accuracy (max 100, each under 50 chars)                            |

## Example - Basic Transcription

```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": "elevenlabs/speech-to-text",
    "input": {
      "audio_url": "https://example.com/audio.mp3"
    }
  }'
```

## Example - With Diarization

```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": "elevenlabs/speech-to-text",
    "input": {
      "audio_url": "https://example.com/meeting.mp3",
      "diarize": true,
      "num_speakers": 3,
      "language_code": "en",
      "timestamps_granularity": "word",
      "tag_audio_events": true,
      "entity_detection": "all",
      "keyterms": ["ElevenLabs", "API"]
    }
  }'
```

## Response

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

## Completed Response

```json theme={null}
{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "abc123def456",
    "status": "completed",
    "output": {
      "language_code": "eng",
      "language_probability": 0.97,
      "text": "Hello world",
      "words": [
        {
          "text": "Hello",
          "start": 0.0,
          "end": 0.5,
          "type": "word",
          "speaker_id": "speaker_0"
        },
        {
          "text": " ",
          "start": 0.5,
          "end": 0.6,
          "type": "spacing"
        },
        {
          "text": "world",
          "start": 0.6,
          "end": 1.0,
          "type": "word",
          "speaker_id": "speaker_0"
        }
      ]
    }
  }
}
```

## Word Object

Each word in the `words` array contains:

| Field        | Type   | Description                                    |
| ------------ | ------ | ---------------------------------------------- |
| `text`       | string | The transcribed text                           |
| `start`      | number | Start time in seconds                          |
| `end`        | number | End time in seconds                            |
| `type`       | string | `"word"`, `"spacing"`, or audio event type     |
| `speaker_id` | string | Speaker identifier (when `diarize` is enabled) |
