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

# 更新角色

> **PUT 会替换整条记录，而不是执行 PATCH。** 请求体与创建接口相同（包括 `name`）。请求中省略的键会从已存储配置中删除。成功响应中的 `data` 是写入后的角色，可用于核对实际保存的内容。

> [accordion] 错误
>
> 错误响应使用相同的 `{code, message, data}` 封装；非零 `code` 表示具体错误。
>
> | 情况 | 错误码 |
> | - | - |
> | 角色不存在、已删除或不属于当前工作区 | `20005 not found` |
> | 其他校验失败 | 与创建角色相同。 |


## OpenAPI

````yaml cn/streaming-avatar/api-references/openapi.json PUT /v1/characters/{character_id}
openapi: 3.1.0
info:
  title: Vivix Streaming Avatar API 中文参考
  version: 1.0.0
  description: Streaming Avatar 会话、音色和角色的 REST 接口。
servers:
  - url: https://api.vivix.ai
security:
  - bearerAuth: []
paths:
  /v1/characters/{character_id}:
    put:
      summary: 更新角色
      description: >-
        **PUT 会替换整条记录，而不是执行 PATCH。** 请求体与创建接口相同（包括
        `name`）。请求中省略的键会从已存储配置中删除。成功响应中的 `data` 是写入后的角色，可用于核对实际保存的内容。
      operationId: updateCharacter
      parameters:
        - name: character_id
          in: path
          required: true
          schema:
            type: string
          description: |-
            要替换的角色 ID。

            请求体参数与创建角色接口相同，校验和内容审核规则也相同。
          example: chr_a1b2c3d4e5f6789012345678abcdef01
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 列表中显示的名称。
                model:
                  type: string
                  description: 模型 ID。请使用 `vivix-a1-stream`。请参阅[模型](/cn/overview/models)。
                session:
                  type: object
                  description: >-
                    初始可变会话状态：模式、当前角色以及用于视频的源图像。可选——只有一个角色时，以下默认规则已经可以确定这些值。会话启动后，可通过控制通道上的
                    `session.update` 修改。
                  properties:
                    mode:
                      type: string
                      description: 会话模式。默认为 `video_avatar`，该模式会流式传输角色视频、语音和文本事件。
                      enum:
                        - video_avatar
                      default: video_avatar
                    active_avatar_id:
                      type: string
                      description: 初始角色 ID。只提供一个角色时可省略；提供多个角色时需要指定。
                    source_image_id:
                      type: string
                      description: 开场图像 ID。省略时使用当前角色的默认图像或唯一图像。如果无法自动选择默认图像，则必须设置。
                output:
                  type: object
                  description: 必填的视频输出设置。创建会话时设置宽高比和分辨率。
                  properties:
                    aspect_ratio:
                      type: string
                      description: >-
                        请求的角色视频宽高比。支持 `9:16` 和
                        `16:9`。请使用相同宽高比的起始图像；宽高比不匹配会明显降低视频质量。
                    resolution:
                      type: string
                      description: 请求的角色视频分辨率。支持 `480p` 和 `720p`。
                avatars:
                  type: array
                  description: 会话中可用的角色。不能为空，且 `avatar_id` 不得重复。
                  items:
                    type: object
                    properties:
                      avatar_id:
                        type: string
                        description: 由调用方定义的角色 ID，在会话内必须唯一。
                      persona:
                        type: string
                        description: >-
                          使用自然语言或 Markdown 描述角色的身份、性格、说话方式、回答习惯、动作偏好和聆听行为。Vivix
                          会根据这段 Persona 自动准备角色行为。请参阅[编写
                          Persona](/cn/streaming-avatar/character/persona)。
                        minLength: 1
                      voice:
                        type: object
                        description: >-
                          多角色会话需要使用不同音色时，可为各角色提供 TTS 配置。请提供
                          `provider`、`provider_voice_id` 和
                          `model`。常规的会话级音色配置无需设置此对象，请改用
                          `pipeline_config.tts_config`。会话级 TTS
                          配置的优先级高于所有角色级音色配置。
                        properties:
                          provider:
                            type: string
                            description: >-
                              TTS 后端，例如
                              `qwen-audio-3.0-tts-flash_ws`、`elevenlabs` 或
                              `qwen3tts`。与 `provider_voice_id` 和 `model`
                              一起使用时必填。
                          provider_voice_id:
                            type: string
                            description: 服务商侧的音色或风格 ID。与 `provider` 和 `model` 一起使用时必填。
                          model:
                            type: string
                            description: >-
                              服务商的 TTS 模型 ID。与 `provider` 和 `provider_voice_id`
                              一起使用时必填。
                          speed:
                            type: number
                            description: 语速倍数。有效范围为 `0.7` 到 `1.2`。
                        required:
                          - provider
                          - provider_voice_id
                          - model
                      visual:
                        type: object
                        description: 视觉渲染设置。该角色用于视频渲染时必填。
                        properties:
                          source_images:
                            type: array
                            description: 该角色可用的已注册源图像。使用基于图像的角色视频渲染时必填。
                            items:
                              type: object
                              description: 一张可选择用于角色视频渲染的源图像。
                              properties:
                                source_image_id:
                                  type: string
                                  description: 由调用方定义的源图像 ID，在角色内必须唯一。
                                url:
                                  type: string
                                  description: >-
                                    可公开访问的源图像 HTTPS URL。其宽高比应与
                                    `output.aspect_ratio`（`9:16` 或
                                    `16:9`）一致；宽高比不匹配会明显降低视频质量。
                                description:
                                  type: string
                                  description: 对人物、姿势和场景的可选说明。
                                media_type:
                                  type: string
                                  description: 图像媒体类型，例如 `image/png` 或 `image/jpeg`。
                                opening:
                                  type: object
                                  description: >-
                                    可选的开场语音或动作。可提供 `dialogue`、`action`
                                    或同时提供两者。选择此图像并开始渲染时执行。
                                  properties:
                                    dialogue:
                                      type: string
                                      description: 要合成的准确开场台词。
                                    action:
                                      type: object
                                      properties:
                                        prompt:
                                          type: string
                                          description: 开场动作的视觉运动提示词。
                                        duration_ms:
                                          type: integer
                                          minimum: 1
                                          description: 开场动作时长，单位为毫秒。
                                      required:
                                        - prompt
                                        - duration_ms
                                      description: 以提示词和持续时间描述的开场动作。
                                    starting_at:
                                      type: integer
                                      minimum: 0
                                      default: 0
                                      description: 从首帧可用起到开场内容开始前的延迟，单位为毫秒。
                              required:
                                - source_image_id
                                - media_type
                                - url
                          default_source_image_id:
                            type: string
                            description: >-
                              默认图像 ID。角色只有一张源图像时可省略；否则请设置此字段或
                              `session.source_image_id`。
                        required:
                          - source_images
                    required:
                      - avatar_id
                      - persona
                  minItems: 1
                pipeline_config:
                  type: object
                  description: 会话级的语音识别、语音合成、对话模型和音频渲染设置。这些设置在创建会话时确定，之后不可更改。
                  properties:
                    tag_audio_enabled:
                      type: boolean
                      description: >-
                        在主要回答前播放“嗯”“唔”等简短语音回应。默认为 `false`。还需要在 Persona 的
                        Speaking Style
                        部分配置开场方式；请参阅[简短语音回应](/cn/streaming-avatar/interaction/acknowledgement)。
                    tts_config:
                      type: object
                      properties:
                        tts_voice_id:
                          type: string
                          description: 内置音色 ID 或 Vivix 克隆的 `voice_id`。提供 `tts_config` 时必填。
                        tts_provider:
                          type: string
                          description: >-
                            语音服务。使用内置 Qwen Audio 音色时默认为
                            `qwen-audio-3.0-tts-flash_ws`。使用 Vivix
                            克隆音色时省略；使用其他服务时需要指定。
                        tts_model_id:
                          type: string
                          description: >-
                            语音模型。使用内置 Qwen Audio 音色时默认为
                            `qwen-audio-3.0-tts-flash`。使用 Vivix
                            克隆音色时省略；使用其他服务时需要指定。
                        tts_endpoint:
                          type: string
                          description: 自定义语音服务端点。使用内置音色或 Vivix 克隆音色时省略。
                        tts_api_key:
                          type: string
                          description: 使用自己的语音服务凭证时，提供语音服务 API 密钥。内置音色不需要单独的密钥。
                        payload:
                          type: object
                          description: >-
                            所选语音服务支持的其他参数。请参阅[语音合成](/cn/streaming-avatar/integrate/speech-synthesis)。
                      required:
                        - tts_voice_id
                      description: 会话级 TTS 配置。其优先级高于所有 `avatars[].voice` 配置。
                    asr_config:
                      type: object
                      properties:
                        provider:
                          type: string
                          description: >-
                            提供 `asr_config` 时必填。优先考虑转写准确率时使用 `doubao`；仅需识别英语时使用
                            `nova-3`。
                        language:
                          type: string
                          description: >-
                            可选的识别语言。例如，豆包可使用 `zh-CN` 或 `en-US`，Nova-3 可使用
                            `en`。该设置作用于输入语音。
                      required:
                        - provider
                      description: >-
                        用于从此角色启动的会话的语音识别配置。省略该对象时使用平台默认的 `vivix-asr`。仅将
                        `provider` 设为
                        `doubao`，即可使用豆包的默认配置。请参阅[语音识别配置](/cn/streaming-avatar/integrate/speech-recognition)。
                    llm_config:
                      type: object
                      properties:
                        llm_backend:
                          type: string
                          description: 可选；目前仅支持 `openai`。
                        llm_base_url:
                          type: string
                          description: 兼容 OpenAI 的基础 URL。使用自定义对话服务时与 `llm_model` 一起提供。
                        llm_model:
                          type: string
                          description: 可选的自定义模型名称。
                        llm_api_key:
                          type: string
                          description: 自定义对话服务需要时，提供对话服务 API 密钥。
                        llm_temperature:
                          type: number
                          description: 可选的生成温度；请使用模型支持的取值范围。
                        llm_max_output_tokens:
                          type: integer
                          description: 可选的生成 token 上限，不是字数上限。
                        llm_extra_payload:
                          type: string
                          description: 可选的 JSON 编码对象字符串；不要传入嵌套对象。
                      description: >-
                        可选的对话模型配置。使用自定义服务时设置 `llm_base_url` 和
                        `llm_model`；也可以只覆盖生成参数。字段类型和示例请参阅[对话模型配置](/cn/streaming-avatar/integrate/dialogue-model)。
                    a2a_config:
                      type: object
                      description: >-
                        使用应用发布的音频驱动角色渲染。请参阅[纯渲染模式](/cn/streaming-avatar/integrate/pure-rendering)。
                      properties:
                        enable_a2a:
                          type: boolean
                          default: false
                          description: 设为 `true`，使用应用的实时音频驱动角色。
                        provider:
                          type: string
                          description: 使用 `passthrough` 渲染应用发布到 RTC 房间的音频。
                          enum:
                            - passthrough
                conversation:
                  type: object
                  description: 会话共享的工具、生成默认值和音频轮次设置。
                  properties:
                    tools:
                      type: array
                      description: 会话中的响应可使用的工具。
                      items:
                        type: object
                        description: 一个工具定义。v1 目前仅记录函数工具。
                        properties:
                          type:
                            type: string
                            description: 请使用 `function`。
                          name:
                            type: string
                            description: 可供响应规划器调用的函数名称。
                          description:
                            type: string
                            description: 便于用户理解的工具使用场景说明。
                          parameters:
                            type: object
                            description: 描述函数参数的 JSON Schema 对象。
                        required:
                          - type
                          - name
                    response_defaults:
                      type: object
                      description: 后续轮次使用的默认响应生成设置。
                      properties:
                        temperature:
                          type: number
                          description: 生成响应文本时使用的采样温度。支持范围为 `0` 到 `2`。
                        max_output_tokens:
                          type: integer
                          description: 单次响应最多生成的文本 token 数。
                    turn_detection:
                      type: object
                      description: 实时用户输入使用的默认轮次处理方式。
                      properties:
                        type:
                          type: string
                          description: >-
                            `manual` 表示由客户端显式启动响应；`server_vad`
                            表示由服务端根据传入的用户音频检测轮次边界。
                        silence_duration_ms:
                          type: integer
                          description: >-
                            兼容字段。不要使用它调整实际的语句结束时机。语音识别和轮次检测配置请参阅[语音识别配置](/cn/streaming-avatar/integrate/speech-recognition)。
                      required:
                        - type
                    input_audio_transcription:
                      type: object
                      description: 用户音频输入使用的默认转录设置。
                      properties:
                        enabled:
                          type: boolean
                          description: 是否转录用户音频。
                        language:
                          type: string
                          description: BCP-47 `language` 代码；也可设为 `auto`，以自动检测语言。
                assets:
                  type: object
                  description: >-
                    可复用的图像引用、音频、语音文本和动作提示。物体互动中的道具或产品请放在 `images`
                    中（请参阅[物体互动](/cn/streaming-avatar/interaction/object-interaction)）；角色的起始图像请放在
                    `avatars[].visual.source_images` 中。所有资产类型的资产 ID 必须互不重复。
                  properties:
                    images:
                      type: array
                      description: 道具或产品的参考图像。它们用于保持对象外观，不会替代角色的起始图像，也不会自行把对象放入场景。
                      items:
                        type: object
                        properties:
                          asset_id:
                            type: string
                            description: 对象引用 ID，在会话资产中必须唯一。请依次使用 `OBJ_0`、`OBJ_1` 等。
                          url:
                            type: string
                            description: 可公开访问的 HTTPS 图像 URL。
                          mime_type:
                            type: string
                            description: 图像 MIME 类型，例如 `image/png` 或 `image/jpeg`。
                          description:
                            type: string
                            description: >-
                              可选的视觉说明。如提供，请包含匹配的引用标签，例如对应 `asset_id: "OBJ_0"` 可写
                              `a dark gray cylindrical
                              speaker<OBJ_0>`。请参阅[物体互动](/cn/streaming-avatar/interaction/object-interaction)。
                        required:
                          - asset_id
                          - url
                    audio:
                      type: array
                      description: 可由脚本化语音输出引用的可复用音频文件。
                      items:
                        type: object
                        description: 一个可复用的音频资产。
                        properties:
                          asset_id:
                            type: string
                            description: 由调用方定义的音频资产 ID。
                          url:
                            type: string
                            description: 音频文件的 HTTPS URL。Vivix 必须能够在不添加自定义请求头的情况下直接访问该 URL。
                          mime_type:
                            type: string
                            description: 音频 MIME 类型。支持 `audio/wav` 和 `audio/mpeg`。
                        required:
                          - asset_id
                          - url
                    speech_text:
                      type: array
                      description: 可由脚本化语音输出引用的可复用准确语音文本。
                      items:
                        type: object
                        description: 一个可复用的语音文本资产。
                        properties:
                          asset_id:
                            type: string
                            description: 由调用方定义的语音文本资产 ID。
                          text:
                            type: string
                            description: 在 `response.script` 中使用时，要合成并通过输出文本事件流式返回的准确文本。
                        required:
                          - asset_id
                          - text
                    visual_prompts:
                      type: array
                      description: 可由脚本化视觉输出引用的可复用视觉指令。
                      items:
                        type: object
                        description: 一个可复用的视觉提示资产。
                        properties:
                          asset_id:
                            type: string
                            description: 由调用方定义的视觉提示资产 ID。
                          prompt:
                            type: string
                            description: 对角色动作、姿势、视线、手势或呈现方式的指令。
                        required:
                          - asset_id
                          - prompt
                delivery:
                  type: object
                  description: 媒体传输和交付设置。省略时默认使用 TRTC。
                  properties:
                    media:
                      type: object
                      description: 选择客户端发送和接收实时媒体的方式。
                      properties:
                        transport:
                          type: string
                          description: >-
                            会话请求使用的媒体传输方式。TRTC 使用 `trtc`，Agora 使用 `agora`。省略时默认为
                            TRTC。响应会在 `delivery.media.trtc` 或
                            `delivery.media.agora` 中返回对应服务商的加入信息。
                max_duration_seconds:
                  type: integer
                  description: >-
                    会话时长上限，单位为秒，最小值为 `4`。标准默认值为 20 分钟（`1200`
                    秒），但受工作区会话时长上限约束。请查看响应中的 `expires_at` 了解实际过期时间。
                  minimum: 4
                auto_close:
                  type: object
                  description: 创建会话时确定的自动关闭策略。响应返回应用平台默认值后实际生效的配置。
                  properties:
                    disconnected_timeout_seconds:
                      type: integer
                      description: >-
                        控制 WebSocket 断开达到指定秒数后关闭会话。省略时使用默认策略；设为 `0` 可禁用；也可设置为
                        `10`–`3600`。非零值不能超过会话时长。
                    interaction_idle_timeout_seconds:
                      type: integer
                      description: >-
                        在没有已接受的客户端交互或检测到的用户语音达到指定秒数后关闭会话。设为 `0` 可禁用；也可设置为
                        `30`–`3600`。非零值不能超过会话时长。Ping/Pong 不计为交互。
                recording_mode:
                  type: string
                  description: '`on` 或 `off`。传入 `off` 可禁用录制。'
              required:
                - name
                - model
                - avatars
                - output
            example:
              name: Studio Host v2
              model: vivix-a1-stream
              output:
                aspect_ratio: '9:16'
                resolution: 720p
              pipeline_config:
                tts_config:
                  tts_provider: qwen-audio-3.0-tts-flash_ws
                  tts_voice_id: longanhuan_v3.6
                  tts_model_id: qwen-audio-3.0-tts-flash
              avatars:
                - avatar_id: host_a
                  persona: You are Host A, a warm livestream host.
                  visual:
                    default_source_image_id: front
                    source_images:
                      - source_image_id: front
                        url: https://cdn.example.com/avatars/host-a-front.png
                        description: >-
                          A woman facing the camera in a brightly lit studio,
                          front view.
                        media_type: image/png
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: integer
                    description: 成功时为 `0`；其他值均为错误码。
                  message:
                    type: string
                    description: '`success`，或英文错误说明。'
                  data:
                    type: object
                    description: 已保存的角色，包括元数据和全部已存储配置。保存时可能会重写源图像 URL。
                    properties:
                      character_id:
                        type: string
                        description: >-
                          角色 ID，格式类似 `chr_…`。可通过[会话
                          API](/cn/streaming-avatar/api-references/sessions)使用该
                          ID 启动会话。
                      name:
                        type: string
                        description: 显示名称。
                      created_at:
                        type: string
                        format: date-time
                        description: UTC 时间，格式为 `YYYY-MM-DDTHH:MM:SSZ`。
                      updated_at:
                        type: string
                        format: date-time
                        description: >-
                          UTC 时间，格式为 `YYYY-MM-DDTHH:MM:SSZ`。


                          **stored config：object**


                          已保存的配置字段与元数据一起在 `data` 下返回。`name`
                          作为元数据存储；`character_id` 和 `idempotency_key`
                          不会保存为会话配置。保存时可能会重写源图像 URL。
                      model:
                        type: string
                        description: >-
                          模型 ID。请使用
                          `vivix-a1-stream`。请参阅[模型](/cn/overview/models)。
                      session:
                        type: object
                        description: >-
                          初始可变会话状态：模式、当前角色以及用于视频的源图像。可选——只有一个角色时，以下默认规则已经可以确定这些值。会话启动后，可通过控制通道上的
                          `session.update` 修改。
                        properties:
                          mode:
                            type: string
                            description: 会话模式。默认为 `video_avatar`，该模式会流式传输角色视频、语音和文本事件。
                            enum:
                              - video_avatar
                            default: video_avatar
                          active_avatar_id:
                            type: string
                            description: 初始角色 ID。只提供一个角色时可省略；提供多个角色时需要指定。
                          source_image_id:
                            type: string
                            description: 开场图像 ID。省略时使用当前角色的默认图像或唯一图像。如果无法自动选择默认图像，则必须设置。
                      output:
                        type: object
                        description: 必填的视频输出设置。创建会话时设置宽高比和分辨率。
                        properties:
                          aspect_ratio:
                            type: string
                            description: >-
                              请求的角色视频宽高比。支持 `9:16` 和
                              `16:9`。请使用相同宽高比的起始图像；宽高比不匹配会明显降低视频质量。
                          resolution:
                            type: string
                            description: 请求的角色视频分辨率。支持 `480p` 和 `720p`。
                      avatars:
                        type: array
                        description: 会话中可用的角色。不能为空，且 `avatar_id` 不得重复。
                        items:
                          type: object
                          properties:
                            avatar_id:
                              type: string
                              description: 由调用方定义的角色 ID，在会话内必须唯一。
                            persona:
                              type: string
                              description: >-
                                使用自然语言或 Markdown
                                描述角色的身份、性格、说话方式、回答习惯、动作偏好和聆听行为。Vivix 会根据这段
                                Persona 自动准备角色行为。请参阅[编写
                                Persona](/cn/streaming-avatar/character/persona)。
                            voice:
                              type: object
                              description: >-
                                多角色会话需要使用不同音色时，可为各角色提供 TTS 配置。请提供
                                `provider`、`provider_voice_id` 和
                                `model`。常规的会话级音色配置无需设置此对象，请改用
                                `pipeline_config.tts_config`。会话级 TTS
                                配置的优先级高于所有角色级音色配置。
                              properties:
                                provider:
                                  type: string
                                  description: >-
                                    TTS 后端，例如
                                    `qwen-audio-3.0-tts-flash_ws`、`elevenlabs` 或
                                    `qwen3tts`。与 `provider_voice_id` 和 `model`
                                    一起使用时必填。
                                provider_voice_id:
                                  type: string
                                  description: >-
                                    服务商侧的音色或风格 ID。与 `provider` 和 `model`
                                    一起使用时必填。
                                model:
                                  type: string
                                  description: >-
                                    服务商的 TTS 模型 ID。与 `provider` 和
                                    `provider_voice_id` 一起使用时必填。
                                speed:
                                  type: number
                                  description: 语速倍数。有效范围为 `0.7` 到 `1.2`。
                              required:
                                - provider
                                - provider_voice_id
                                - model
                            visual:
                              type: object
                              description: 视觉渲染设置。该角色用于视频渲染时必填。
                              properties:
                                source_images:
                                  type: array
                                  description: 该角色可用的已注册源图像。使用基于图像的角色视频渲染时必填。
                                  items:
                                    type: object
                                    description: 一张可选择用于角色视频渲染的源图像。
                                    properties:
                                      source_image_id:
                                        type: string
                                        description: 由调用方定义的源图像 ID，在角色内必须唯一。
                                      url:
                                        type: string
                                        description: >-
                                          可公开访问的源图像 HTTPS URL。其宽高比应与
                                          `output.aspect_ratio`（`9:16` 或
                                          `16:9`）一致；宽高比不匹配会明显降低视频质量。
                                      description:
                                        type: string
                                        description: 对人物、姿势和场景的可选说明。
                                      media_type:
                                        type: string
                                        description: 图像媒体类型，例如 `image/png` 或 `image/jpeg`。
                                      opening:
                                        type: object
                                        description: >-
                                          可选的开场语音或动作。可提供 `dialogue`、`action`
                                          或同时提供两者。选择此图像并开始渲染时执行。
                                        properties:
                                          dialogue:
                                            type: string
                                            description: 要合成的准确开场台词。
                                          action:
                                            type: object
                                            properties:
                                              prompt:
                                                type: string
                                                description: 开场动作的视觉运动提示词。
                                              duration_ms:
                                                type: integer
                                                minimum: 1
                                                description: 开场动作时长，单位为毫秒。
                                            required:
                                              - prompt
                                              - duration_ms
                                            description: 以提示词和持续时间描述的开场动作。
                                          starting_at:
                                            type: integer
                                            minimum: 0
                                            default: 0
                                            description: 从首帧可用起到开场内容开始前的延迟，单位为毫秒。
                                    required:
                                      - source_image_id
                                      - media_type
                                      - url
                                default_source_image_id:
                                  type: string
                                  description: >-
                                    默认图像 ID。角色只有一张源图像时可省略；否则请设置此字段或
                                    `session.source_image_id`。
                              required:
                                - source_images
                          required:
                            - avatar_id
                        minItems: 1
                      pipeline_config:
                        type: object
                        description: 会话级的语音识别、语音合成、对话模型和音频渲染设置。这些设置在创建会话时确定，之后不可更改。
                        properties:
                          tag_audio_enabled:
                            type: boolean
                            description: >-
                              在主要回答前播放“嗯”“唔”等简短语音回应。默认为 `false`。还需要在 Persona 的
                              Speaking Style
                              部分配置开场方式；请参阅[简短语音回应](/cn/streaming-avatar/interaction/acknowledgement)。
                          tts_config:
                            type: object
                            properties:
                              tts_voice_id:
                                type: string
                                description: >-
                                  内置音色 ID 或 Vivix 克隆的 `voice_id`。提供 `tts_config`
                                  时必填。
                              tts_provider:
                                type: string
                                description: >-
                                  语音服务。使用内置 Qwen Audio 音色时默认为
                                  `qwen-audio-3.0-tts-flash_ws`。使用 Vivix
                                  克隆音色时省略；使用其他服务时需要指定。
                              tts_model_id:
                                type: string
                                description: >-
                                  语音模型。使用内置 Qwen Audio 音色时默认为
                                  `qwen-audio-3.0-tts-flash`。使用 Vivix
                                  克隆音色时省略；使用其他服务时需要指定。
                              tts_endpoint:
                                type: string
                                description: 自定义语音服务端点。使用内置音色或 Vivix 克隆音色时省略。
                              tts_api_key:
                                type: string
                                description: 使用自己的语音服务凭证时，提供语音服务 API 密钥。内置音色不需要单独的密钥。
                              payload:
                                type: object
                                description: >-
                                  所选语音服务支持的其他参数。请参阅[语音合成](/cn/streaming-avatar/integrate/speech-synthesis)。
                            required:
                              - tts_voice_id
                            description: 会话级 TTS 配置。其优先级高于所有 `avatars[].voice` 配置。
                          asr_config:
                            type: object
                            properties:
                              provider:
                                type: string
                                description: 已保存的语音识别服务商。
                              language:
                                type: string
                                description: >-
                                  可选的识别语言。例如，豆包可使用 `zh-CN` 或 `en-US`，Nova-3 可使用
                                  `en`。该设置作用于输入语音。
                            required:
                              - provider
                            description: >-
                              已保存的语音识别配置。如果该配置不存在，从此角色启动的会话会使用平台默认的
                              `vivix-asr`。请参阅[语音识别配置](/cn/streaming-avatar/integrate/speech-recognition)。
                          llm_config:
                            type: object
                            properties:
                              llm_backend:
                                type: string
                                description: 可选；目前仅支持 `openai`。
                              llm_base_url:
                                type: string
                                description: >-
                                  兼容 OpenAI 的基础 URL。使用自定义对话服务时与 `llm_model`
                                  一起提供。
                              llm_model:
                                type: string
                                description: 可选的自定义模型名称。
                              llm_api_key:
                                type: string
                                description: 自定义对话服务需要时，提供对话服务 API 密钥。
                              llm_temperature:
                                type: number
                                description: 可选的生成温度；请使用模型支持的取值范围。
                              llm_max_output_tokens:
                                type: integer
                                description: 可选的生成 token 上限，不是字数上限。
                              llm_extra_payload:
                                type: string
                                description: 可选的 JSON 编码对象字符串；不要传入嵌套对象。
                            description: >-
                              可选的对话模型配置。使用自定义服务时设置 `llm_base_url` 和
                              `llm_model`；也可以只覆盖生成参数。字段类型和示例请参阅[对话模型配置](/cn/streaming-avatar/integrate/dialogue-model)。
                          a2a_config:
                            type: object
                            description: >-
                              使用应用发布的音频驱动角色渲染。请参阅[纯渲染模式](/cn/streaming-avatar/integrate/pure-rendering)。
                            properties:
                              enable_a2a:
                                type: boolean
                                default: false
                                description: 设为 `true`，使用应用的实时音频驱动角色。
                              provider:
                                type: string
                                description: 使用 `passthrough` 渲染应用发布到 RTC 房间的音频。
                                enum:
                                  - passthrough
                      conversation:
                        type: object
                        description: 会话共享的工具、生成默认值和音频轮次设置。
                        properties:
                          tools:
                            type: array
                            description: 会话中的响应可使用的工具。
                            items:
                              type: object
                              description: 一个工具定义。v1 目前仅记录函数工具。
                              properties:
                                type:
                                  type: string
                                  description: 请使用 `function`。
                                name:
                                  type: string
                                  description: 可供响应规划器调用的函数名称。
                                description:
                                  type: string
                                  description: 便于用户理解的工具使用场景说明。
                                parameters:
                                  type: object
                                  description: 描述函数参数的 JSON Schema 对象。
                              required:
                                - type
                                - name
                          response_defaults:
                            type: object
                            description: 后续轮次使用的默认响应生成设置。
                            properties:
                              temperature:
                                type: number
                                description: 生成响应文本时使用的采样温度。支持范围为 `0` 到 `2`。
                              max_output_tokens:
                                type: integer
                                description: 单次响应最多生成的文本 token 数。
                          turn_detection:
                            type: object
                            description: 实时用户输入使用的默认轮次处理方式。
                            properties:
                              type:
                                type: string
                                description: >-
                                  `manual` 表示由客户端显式启动响应；`server_vad`
                                  表示由服务端根据传入的用户音频检测轮次边界。
                              silence_duration_ms:
                                type: integer
                                description: >-
                                  兼容字段。不要使用它调整实际的语句结束时机。语音识别和轮次检测配置请参阅[语音识别配置](/cn/streaming-avatar/integrate/speech-recognition)。
                            required:
                              - type
                          input_audio_transcription:
                            type: object
                            description: 用户音频输入使用的默认转录设置。
                            properties:
                              enabled:
                                type: boolean
                                description: 是否转录用户音频。
                              language:
                                type: string
                                description: BCP-47 `language` 代码；也可设为 `auto`，以自动检测语言。
                      assets:
                        type: object
                        description: >-
                          可复用的图像引用、音频、语音文本和动作提示。物体互动中的道具或产品请放在 `images`
                          中（请参阅[物体互动](/cn/streaming-avatar/interaction/object-interaction)）；角色的起始图像请放在
                          `avatars[].visual.source_images` 中。所有资产类型的资产 ID
                          必须互不重复。
                        properties:
                          images:
                            type: array
                            description: 道具或产品的参考图像。它们用于保持对象外观，不会替代角色的起始图像，也不会自行把对象放入场景。
                            items:
                              type: object
                              properties:
                                asset_id:
                                  type: string
                                  description: 对象引用 ID，在会话资产中必须唯一。请依次使用 `OBJ_0`、`OBJ_1` 等。
                                url:
                                  type: string
                                  description: 可公开访问的 HTTPS 图像 URL。
                                mime_type:
                                  type: string
                                  description: 图像 MIME 类型，例如 `image/png` 或 `image/jpeg`。
                                description:
                                  type: string
                                  description: >-
                                    可选的视觉说明。如提供，请包含匹配的引用标签，例如对应 `asset_id:
                                    "OBJ_0"` 可写 `a dark gray cylindrical
                                    speaker<OBJ_0>`。请参阅[物体互动](/cn/streaming-avatar/interaction/object-interaction)。
                              required:
                                - asset_id
                                - url
                          audio:
                            type: array
                            description: 可由脚本化语音输出引用的可复用音频文件。
                            items:
                              type: object
                              description: 一个可复用的音频资产。
                              properties:
                                asset_id:
                                  type: string
                                  description: 由调用方定义的音频资产 ID。
                                url:
                                  type: string
                                  description: >-
                                    音频文件的 HTTPS URL。Vivix
                                    必须能够在不添加自定义请求头的情况下直接访问该 URL。
                                mime_type:
                                  type: string
                                  description: 音频 MIME 类型。支持 `audio/wav` 和 `audio/mpeg`。
                              required:
                                - asset_id
                                - url
                          speech_text:
                            type: array
                            description: 可由脚本化语音输出引用的可复用准确语音文本。
                            items:
                              type: object
                              description: 一个可复用的语音文本资产。
                              properties:
                                asset_id:
                                  type: string
                                  description: 由调用方定义的语音文本资产 ID。
                                text:
                                  type: string
                                  description: >-
                                    在 `response.script`
                                    中使用时，要合成并通过输出文本事件流式返回的准确文本。
                              required:
                                - asset_id
                                - text
                          visual_prompts:
                            type: array
                            description: 可由脚本化视觉输出引用的可复用视觉指令。
                            items:
                              type: object
                              description: 一个可复用的视觉提示资产。
                              properties:
                                asset_id:
                                  type: string
                                  description: 由调用方定义的视觉提示资产 ID。
                                prompt:
                                  type: string
                                  description: 对角色动作、姿势、视线、手势或呈现方式的指令。
                              required:
                                - asset_id
                                - prompt
                      delivery:
                        type: object
                        description: 媒体传输和交付设置。省略时默认使用 TRTC。
                        properties:
                          media:
                            type: object
                            description: 选择客户端发送和接收实时媒体的方式。
                            properties:
                              transport:
                                type: string
                                description: >-
                                  会话请求使用的媒体传输方式。TRTC 使用 `trtc`，Agora 使用
                                  `agora`。省略时默认为 TRTC。响应会在 `delivery.media.trtc`
                                  或 `delivery.media.agora` 中返回对应服务商的加入信息。
                      max_duration_seconds:
                        type: integer
                        description: >-
                          会话时长上限，单位为秒，最小值为 `4`。标准默认值为 20 分钟（`1200`
                          秒），但受工作区会话时长上限约束。请查看响应中的 `expires_at` 了解实际过期时间。
                        minimum: 4
                      auto_close:
                        type: object
                        description: 创建会话时确定的自动关闭策略。响应返回应用平台默认值后实际生效的配置。
                        properties:
                          disconnected_timeout_seconds:
                            type: integer
                            description: >-
                              控制 WebSocket 断开达到指定秒数后关闭会话。省略时使用默认策略；设为 `0`
                              可禁用；也可设置为 `10`–`3600`。非零值不能超过会话时长。
                          interaction_idle_timeout_seconds:
                            type: integer
                            description: >-
                              在没有已接受的客户端交互或检测到的用户语音达到指定秒数后关闭会话。设为 `0` 可禁用；也可设置为
                              `30`–`3600`。非零值不能超过会话时长。Ping/Pong 不计为交互。
                      recording_mode:
                        type: string
                        description: '`on` 或 `off`。传入 `off` 可禁用录制。'
                    required:
                      - character_id
                      - name
                      - created_at
                      - updated_at
                      - output
              example:
                code: 0
                message: success
                data:
                  character_id: chr_a1b2c3d4e5f6789012345678abcdef01
                  name: Studio Host v2
                  created_at: '2026-08-19T10:00:00Z'
                  updated_at: '2026-08-19T11:00:00Z'
                  model: vivix-a1-stream
                  output:
                    aspect_ratio: '9:16'
                    resolution: 720p
                  pipeline_config:
                    tts_config:
                      tts_provider: qwen-audio-3.0-tts-flash_ws
                      tts_voice_id: longanhuan_v3.6
                      tts_model_id: qwen-audio-3.0-tts-flash
                  avatars:
                    - avatar_id: host_a
                      persona: You are Host A, a warm livestream host.
                      visual:
                        default_source_image_id: front
                        source_images:
                          - source_image_id: front
                            url: https://cdn.example.com/avatars/host-a-front.png
                            description: >-
                              A woman facing the camera in a brightly lit
                              studio, front view.
                            media_type: image/png
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 你的 Vivix API 密钥。请仅保存在服务端。

````

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