> ## Documentation Index
> Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ElevenLabs

> Transcribe audio to text using ElevenLabs Scribe V2 model.

<Info>
  **Product**: Visual Intelligence — Audio File Transcription
  **Use case**: Transcribe an uploaded audio/video **file** to text — async batch or sync, multiple providers (Whisper, ElevenLabs, AssemblyAI) with optional speaker labels. For live streams, see Live Audio Transcription.
  **Host**: `https://mavi-backend.memories.ai/serve/api/v2`
  **Auth**: `Authorization: sk-mavi-...` (no `Bearer` prefix)
</Info>

Uses **ElevenLabs Scribe V2** model. Returns results synchronously.

<Note>
  **Pricing:** \$0.39/hour of audio, billed by actual audio duration (in seconds).
</Note>

## Audio Source

You must provide **one** of the following (priority: `asset_id` > `url` > `source_url`).

## Parameters

<ParamField header="Authorization" type="string" required>
  API key for authentication (e.g. `sk-mavi-...`).
</ParamField>

<ParamField body="provider" type="string" default="elevenlabs">
  STT provider. Use `elevenlabs` for this endpoint.
</ParamField>

<ParamField body="asset_id" type="string">
  The unique identifier of an uploaded audio/video asset (e.g. `re_xxx`). Resolved to a signed GCS URL.
</ParamField>

<ParamField body="url" type="string">
  A publicly accessible audio URL.
</ParamField>

<ParamField body="source_url" type="string">
  A `gs://` GCS path or public HTTP URL. GCS paths are converted to signed URLs automatically.
</ParamField>

<ParamField body="language_code" type="string">
  Language code (ISO 639-1, e.g. `en`, `zh`). If omitted, the provider auto-detects the language.
</ParamField>

<ParamField body="model_id" type="string" default="scribe_v2">
  Model to use.
</ParamField>

<ParamField body="diarize" type="boolean">
  Enable speaker diarization.
</ParamField>

<ParamField body="timestamps_granularity" type="string">
  Timestamp level: `none`, `segment`, or `word`.
</ParamField>

<ParamField body="tag_audio_events" type="boolean">
  Tag audio events such as music, laughter, applause.
</ParamField>

<ParamField body="num_speakers" type="integer">
  Expected number of speakers (improves diarization).
</ParamField>

<ParamField body="file_format" type="string">
  Audio format hint (e.g. `pcm_s16le_16000`).
</ParamField>

<ParamField body="source_lang" type="string">
  Source language for translation.
</ParamField>

<ParamField body="target_lang" type="string">
  Target language for translation.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://mavi-backend.memories.ai/serve/api/v2/transcriptions/speech-to-text \
    --header 'Authorization: sk-mavi-...' \
    --header 'Content-Type: application/json' \
    --data '{
      "provider": "elevenlabs",
      "asset_id": "re_657929111888723968",
      "model_id": "scribe_v2",
      "language_code": "en",
      "diarize": true,
      "timestamps_granularity": "word",
      "num_speakers": 2
    }'
  ```

  ```javascript fetch theme={null}
  const BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2/transcriptions";
  const API_KEY = "sk-mavi-...";

  const response = await fetch(`${BASE_URL}/speech-to-text`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': API_KEY
    },
    body: JSON.stringify({
      provider: 'elevenlabs',
      asset_id: 're_657929111888723968',
      model_id: 'scribe_v2',
      language_code: 'en',
      diarize: true,
      timestamps_granularity: 'word',
      num_speakers: 2
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2/transcriptions"
  API_KEY = "sk-mavi-..."
  HEADERS = {
      "Authorization": API_KEY,
      "Content-Type": "application/json"
  }

  response = requests.post(f"{BASE_URL}/speech-to-text", json={
      "provider": "elevenlabs",
      "asset_id": "re_657929111888723968",
      "model_id": "scribe_v2",
      "language_code": "en",
      "diarize": True,
      "timestamps_granularity": "word",
      "num_speakers": 2
  }, headers=HEADERS)

  print(response.json())
  ```
</CodeGroup>

## Response

<ResponseExample>
  ```json Response theme={null}
  {
    "code": 200,
    "msg": "success",
    "data": {
      "language_code": "en",
      "language_probability": 0.98,
      "text": "Hello, how are you today? I'm doing well, thank you.",
      "words": [
        {
          "text": "Hello,",
          "start": 0.0,
          "end": 0.52,
          "type": "word",
          "speaker_id": "speaker_0"
        },
        {
          "text": " ",
          "start": 0.52,
          "end": 0.52,
          "type": "spacing"
        },
        {
          "text": "how",
          "start": 0.52,
          "end": 0.78,
          "type": "word",
          "speaker_id": "speaker_0"
        }
      ]
    },
    "failed": false,
    "success": true
  }
  ```
</ResponseExample>

### Response Parameters

| Parameter                  | Type           | Description                                                              |
| -------------------------- | -------------- | ------------------------------------------------------------------------ |
| data.language\_code        | string         | Detected language code (ISO 639-1)                                       |
| data.language\_probability | number         | Confidence of language detection (0.0–1.0)                               |
| data.text                  | string         | Full transcription text                                                  |
| data.words                 | array\[object] | Word-level transcription with timing                                     |
| data.words\[].text         | string         | The word or spacing text                                                 |
| data.words\[].start        | number         | Start time in seconds                                                    |
| data.words\[].end          | number         | End time in seconds                                                      |
| data.words\[].type         | string         | Token type: `word`, `spacing`, or `audio_event`                          |
| data.words\[].speaker\_id  | string         | Speaker identifier (e.g. `speaker_0`). Only present when `diarize=true`. |

<Note>
  **Timestamps** are in **seconds** (e.g. `0.52`).
</Note>
