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

# ElevenLabs Scribe v2

> ElevenLabs Scribe v2 API 把最长 120 分钟的音频或视频转写成文字，附逐词时间戳、说话人标注、音频事件标签和关键词提示。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口获取结果。

ElevenLabs Scribe v2 是 ElevenLabs 的语音转文字模型，ElevenLabs 公布其支持 90 多种语言。ElevenLabs Scribe v2 API 接收一个音频文件或带声音的视频，返回包含逐词时间戳、说话人标注和笑声等声音事件标签的文字稿。适用于字幕、会议与访谈记录、可搜索的媒体库和语音数据处理流程。

## 模型

* **elevenlabs/stt/scribe-v2** — ElevenLabs Scribe v2 语音转文字，支持最长 120 分钟的音频或视频。

## 功能

* 自动识别语言，或指定 `language_code`。
* 以秒为单位的逐词起止时间。
* 说话人分离，每个词都有 `speaker_id`。
* 为非语音声音添加音频事件标签。
* 关键词提示，最多 100 个人名或术语。

## 必填参数

* `audio_url` (string)：音频文件或带音轨的视频，最大 100 MB、120 分钟，须为可公开访问的 HTTP(S) 地址。

## 可选参数

* `language_code` (string)：ISO 639-1 或 ISO 639-3 代码，例如 `en` 或 `eng`。不传则自动识别。
* `tag_audio_events` (boolean)：标记笑声、掌声等声音，默认 `true`。
* `diarize` (boolean)：按说话人标注词语，默认 `true`。
* `keyterms` (string\[])：最多 100 个需要准确拼写的词，每个不超过 50 个字符。

## 输出

任务完成后，文字稿出现在两个位置：

* [查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)和回调内容中的 `data.output`：`text`（完整文字稿）、`text_truncated`、`language_code`（识别出的语言，ISO 639-3，例如 `spa`）、`language_probability` 和 `transcript_url`。
* `data.files[0]`：同一个 `transcript.json` 文件（`file_type: other`，`content_type: application/json`）。

```json Finished status response theme={"dark"}
{
  "code": 200,
  "data": {
    "task_id": "IPS7Y2J0Y6MZGLME",
    "status": "finished",
    "files": [
      {
        "file_url": "https://cdn.vidgo.ai/apis/models/elevenlabs/stt/scribe-v2/v1/01/transcript.json",
        "file_type": "other",
        "format": "json",
        "content_type": "application/json",
        "file_name": "transcript.json"
      }
    ],
    "output": {
      "text": "Primero calentamos el comal sin aceite. Los chiles chilhuacle se tuestan apenas unos segundos por lado. …",
      "text_truncated": false,
      "language_code": "spa",
      "language_probability": 1.0,
      "transcript_url": "https://cdn.vidgo.ai/apis/models/elevenlabs/stt/scribe-v2/v1/01/transcript.json"
    },
    "created_time": "2026-11-25T17:07:21",
    "error_message": null,
    "progress": 100
  }
}
```

`transcript.json` 列出每个词，包含以秒为单位的 `start`、`end`，`type`（`word`、`spacing` 或 `audio_event`）和 `speaker_id`：

```json transcript.json theme={"dark"}
{
  "text": "Primero calentamos el comal sin aceite. …",
  "language_code": "spa",
  "language_probability": 1.0,
  "words": [
    {
      "text": "Primero",
      "start": 0.12,
      "end": 0.52,
      "type": "word",
      "speaker_id": "speaker_0"
    },
    {
      "text": " ",
      "start": 0.52,
      "end": 0.6,
      "type": "spacing",
      "speaker_id": "speaker_0"
    },
    {
      "text": "calentamos",
      "start": 0.6,
      "end": 1.18,
      "type": "word",
      "speaker_id": "speaker_0"
    }
  ]
}
```

## 示例

* **带关键词的西班牙语录音**：`language_code: es`，开启说话人分离和事件标签，`keyterms` 中放三个地方词汇。
* **自动识别视频语言**：只传指向 MP4 的 `audio_url`，并附 `callback_url`。

## 注意事项

* 提交时会测量媒体。超过 100 MB 或 120 分钟、无法下载或读取的文件，以及没有音轨的视频会返回 400。
* 提交时按媒体时长（向上取整到秒，至少 1 秒）扣除积分。非空的 `keyterms` 列表按更高的每分钟费率计费，空列表会被忽略。任务失败会全额退还积分。当前价格见[定价页](https://vidgo.ai/apis/api-pricing)。
* `input` 中的未知字段、长度在 2–3 个字母以外的 `language_code`、超过 100 个关键词或超过 50 个字符的关键词会返回 400。


## OpenAPI

````yaml zh/api-manual/music-series/elevenlabs-stt-scribe-v2.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - ElevenLabs Scribe v2
  description: ElevenLabs Scribe v2 API 把最长 120 分钟的音频或视频转写成文字，附逐词时间戳、说话人标注、音频事件标签和关键词提示。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: 生产环境服务器
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - ElevenLabs Scribe v2
      summary: 提交 ElevenLabs Scribe v2 任务
      operationId: submitElevenLabsScribeV2Task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              keyterms:
                summary: 带关键词的西班牙语录音
                value:
                  model: elevenlabs/stt/scribe-v2
                  input:
                    audio_url: >-
                      https://cdn.vidgo.ai/apis/models/elevenlabs/stt/scribe-v2/v1/01/input-audio.mp3
                    language_code: es
                    tag_audio_events: true
                    diarize: true
                    keyterms:
                      - chilhuacle
                      - mole negro
                      - comal
              auto:
                summary: 自动识别视频语言
                value:
                  model: elevenlabs/stt/scribe-v2
                  input:
                    audio_url: https://example.com/meeting.mp4
                  callback_url: https://your-domain.com/callback
      responses:
        '200':
          description: 任务提交结果。task_id 标识异步任务，生成可能仍在进行。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: 请求参数无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 未授权
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          example: elevenlabs/stt/scribe-v2
        callback_url:
          type: string
          format: uri
          description: 可选的 Webhook 地址，任务完成或失败时接收通知。
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - audio_url
          additionalProperties: false
          properties:
            audio_url:
              type: string
              format: uri
              description: >-
                音频文件（MP3、WAV、M4A、AAC、FLAC、OGG、WebM
                等）或带音轨的视频（MP4、MOV、MKV、WebM），最大 100 MB、120 分钟。


                请使用可公开访问的 HTTP(S) 下载地址。
            language_code:
              type: string
              minLength: 2
              maxLength: 3
              description: ISO 639-1 或 ISO 639-3 语言代码，例如 `en` 或 `eng`。不传则自动识别语言。
            tag_audio_events:
              type: boolean
              default: true
              description: 在文字稿中标记笑声、掌声等非语音声音。
            diarize:
              type: boolean
              default: true
              description: 为每个词标注说话人（`speaker_0`、`speaker_1` …）。
            keyterms:
              type: array
              maxItems: 100
              items:
                type: string
                minLength: 1
                maxLength: 50
              description: 最多 100 个需要准确拼写的词或短语（如人名、术语），每个不超过 50 个字符。非空列表按关键词费率计费。
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-example-001
            status:
              type: string
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-11-25T10:30:00'
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: 错误信息，参见[错误码](/zh/api-manual/error-codes)。
          example: audio_url is required
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        使用 `Authorization: Bearer VIDGO_API_KEY`。在 **仪表盘 → API
        密钥**（https://vidgo.ai/apis/dashboard/api-key）创建密钥。

````

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