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

# 获取带时间戳的歌词

> 获取带时间戳的歌词，用于音频播放时的同步显示。

### 参数选择逻辑

1. audioId 参数：
   * audioId 参数为必需参数，用于标识确切的曲目
   * 为生成任务中的音频轨道提供唯一标识符

### 开发者注意事项

1. 时间戳值以秒为单位
2. 返回的波形数据可用于音频可视化
3. 对于纯音乐曲目（使用 instrumental=true 生成的），将没有歌词数据
4. 典型用例：音乐播放器界面中的卡拉OK式歌词显示


## OpenAPI

````yaml cn/suno-api/suno-api-cn.json POST /api/v1/generate/get-timestamped-lyrics
openapi: 3.0.0
info:
  title: intro
  description: 这是生成音频的API接口文档
  version: 1.0.0
  contact:
    name: 技术支持
    email: support@sunoapi.org
servers:
  - url: https://api.sunoapi.org
    description: API 服务器
security:
  - BearerAuth: []
tags:
  - name: Music Generation
    description: 用于创建和管理音乐生成任务的接口
  - name: Lyrics Generation
    description: 用于歌词生成和管理的接口
  - name: WAV Conversion
    description: 用于将音乐转换为WAV格式的接口
  - name: Vocal Removal
    description: 用于从音乐轨道中移除人声的接口
  - name: Music Video Generation
    description: 用于生成MP4视频的接口
  - name: Account Management
    description: 用于账户和积分管理的接口
paths:
  /api/v1/generate/get-timestamped-lyrics:
    post:
      summary: 获取带时间戳的歌词
      operationId: get-timestamped-lyrics
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - taskId
                - audioId
              properties:
                taskId:
                  type: string
                  description: 音乐生成任务的任务ID。用于标识包含歌词的生成任务。
                  example: 5c79****be8e
                audioId:
                  type: string
                  description: 要获取歌词的音轨的音频ID。
                  example: e231****-****-****-****-****8cadc7dc
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          alignedWords:
                            type: array
                            description: 对齐的歌词单词列表
                            items:
                              type: object
                              properties:
                                word:
                                  type: string
                                  description: 歌词单词
                                  example: |-
                                    [Verse]
                                    Waggin'
                                success:
                                  type: boolean
                                  description: 歌词单词是否成功对齐
                                  example: true
                                startS:
                                  type: number
                                  description: 单词开始时间（秒）
                                  example: 1.36
                                endS:
                                  type: number
                                  description: 单词结束时间（秒）
                                  example: 1.79
                                palign:
                                  type: integer
                                  description: 对齐参数
                                  example: 0
                          waveformData:
                            type: array
                            description: 波形数据，用于音频可视化
                            items:
                              type: number
                            example:
                              - 0
                              - 1
                              - 0.5
                              - 0.75
                          hootCer:
                            type: number
                            description: 歌词对齐准确度评分
                            example: 0.3803191489361702
                          isStreamed:
                            type: boolean
                            description: 是否为流式音频
                            example: false
              example:
                code: 200
                msg: success
                data:
                  alignedWords:
                    - word: |-
                        [Verse]
                        Waggin'
                      success: true
                      startS: 1.36
                      endS: 1.79
                      palign: 0
                  waveformData:
                    - 0
                    - 1
                    - 0.5
                    - 0.75
                  hootCer: 0.3803191489361702
                  isStreamed: false
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    ApiResponse:
      type: object
      properties:
        code:
          type: integer
          description: |-
            # 状态码说明

            - ✅ 200 - 请求成功
            - ⚠️ 400 - 参数错误
            - ⚠️ 401 - 没有访问权限
            - ⚠️ 404 - 请求方式或者路径错误
            - ⚠️ 405 - 调用超过限制
            - ⚠️ 413 - 主题或者prompt过长
            - ⚠️ 429 - 积分不足
            - ⚠️ 430 - 您的调用频率过高，请稍后再试。
            - ⚠️ 455 - 网站维护
            - ❌ 500 - 服务器异常
          example: 200
          enum:
            - 200
            - 400
            - 401
            - 404
            - 405
            - 413
            - 429
            - 430
            - 455
            - 500
        msg:
          type: string
          description: 当 code != 200 时，展示错误信息
          example: success
  responses:
    Error:
      description: 服务器异常
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |-
        # 🔑 API 认证说明

        所有接口都需要通过 Bearer Token 方式进行认证。

        ## 获取 API Key

        1. 访问 [API Key 管理页面](https://sunoapi.org/api-key) 获取您的 API Key

        ## 使用方式

        在请求头中添加：

        ```
        Authorization: Bearer YOUR_API_KEY
        ```

        > **⚠️ 注意：**
        > - 请妥善保管您的 API Key，不要泄露给他人
        > - 如果怀疑 API Key 泄露，请立即在管理页面重置

````