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

# 导出 3D 角色

> 仅对以 `type` `vsplat` 或 `all` 创建的角色有意义；仅 `render` 的角色没有可导出的内容。`vsplat_url` 仅在请求带有 `download_type=vsplat` 时才会填充，且每次调用都会重新签名。`thumbnail_url` 不受条件限制：只要提取生成了缩略图就会填充，与 `download_type` 无关，因为它是提取的默认输出，而不是调用方需要主动选择获取的资产。角色导出没有 `glb` 输出：`download_type` 只接受 `vsplat`；`glb` 提取仅适用于动作（见 `GET /v1/motions/{motion_id}/export`）。替代旧的 `GET /v1/avatars/{avatar_id}`。

导出仅对创建该角色的 API 密钥可见；其他密钥会得到 `404 CHARACTER_NOT_FOUND`。导出文件被删除后，此接口返回 `404 RESULT_EXPIRED`。




## OpenAPI

````yaml zh/openapi.yaml GET /v1/characters/{character_id}/export
openapi: 3.0.3
info:
  title: Viggle API
  description: >
    Viggle API 可生成 AI 视频（Viggle H3、Viggle Remake、Video Remix）、图片（Viggle Image）、2
    倍视频超分（FlashVSR），以及 JST-2 3D 角色、动作和场景。所有任务都是异步的：先创建，再轮询（渲染任务也可监听进度），直到任务进入终态。


    基础 URL：`https://apis.viggle.ai`。每个请求都需通过 `Authorization: Bearer <API key>`
    认证。用量按积分计费（1 积分 = $0.01）。指南与价格：https://docs.viggle.ai/zh/v1/introduction
  version: 2.0.0
  contact:
    name: Viggle Support
    url: https://viggle.ai
servers:
  - url: https://apis.viggle.ai
    description: 生产环境服务器
security:
  - bearerAuth: []
tags:
  - name: Renders
    description: >-
      Video Remix（JST-1）。准备输入、创建渲染任务、监听进度、取消以及下载结果。渲染任务的状态通过 `GET
      /v1/videos/{video_id}` 读取。
  - name: Credits
    description: 读取调用方 API 密钥可用的积分余额。
  - name: Characters
    description: |
      创建、列出、查看和删除可复用的角色资产。`type` 决定创建时是否同时提取 3D vsplat；就绪后需单独导出其下载链接。
  - name: Motions
    description: |
      创建、列出、查看和删除可复用的动作资产，也可从官方动作模板导入。`type` 决定创建时是否同时提取或生成 3D 动画；就绪后需单独导出其下载链接。
  - name: Videos
    description: >
      从文本、帧或参考素材生成 Viggle H3 视频（`vid_` 前缀），或从驱动视频和角色图生成 Viggle Remake 视频（`anim_`
      前缀）；用 FlashVSR 将视频超分 2 倍（`vsr_` 前缀）；并以统一视图读取调用方 API 密钥创建的所有视频——H3
      生成、Remake 生成以及 Video Remix 渲染任务（`render_` 前缀）——合并为同一种资源。
  - name: Images
    description: |
      Viggle Image——根据文本提示词生成 1–6 张 PNG 图片，可选用最多 8 张参考图引导（`img_` 前缀），并可按 ID 获取。
  - name: Scenes
    description: >
      场景模型——从文本提示词或 360° 全景图构建 3D
      高斯泼溅场景（`.spz`），生成新的指定位姿视角，并基于这些视角重建场景。每个操作都是一个异步任务（`scn_` 前缀），按 ID
      读取结果。每次运行按每个视角 1 积分计费，一张全景图计为 6 个视角。除非任务以 `ready` 结束，否则积分全额退款。
paths:
  /v1/characters/{character_id}/export:
    parameters:
      - $ref: '#/components/parameters/CharacterId'
      - $ref: '#/components/parameters/RequestId'
    get:
      tags:
        - Characters
      summary: 导出 3D 角色
      description: >
        仅对以 `type` `vsplat` 或 `all` 创建的角色有意义；仅 `render` 的角色没有可导出的内容。`vsplat_url`
        仅在请求带有 `download_type=vsplat` 时才会填充，且每次调用都会重新签名。`thumbnail_url`
        不受条件限制：只要提取生成了缩略图就会填充，与 `download_type`
        无关，因为它是提取的默认输出，而不是调用方需要主动选择获取的资产。角色导出没有 `glb` 输出：`download_type` 只接受
        `vsplat`；`glb` 提取仅适用于动作（见 `GET /v1/motions/{motion_id}/export`）。替代旧的
        `GET /v1/avatars/{avatar_id}`。


        导出仅对创建该角色的 API 密钥可见；其他密钥会得到 `404 CHARACTER_NOT_FOUND`。导出文件被删除后，此接口返回
        `404 RESULT_EXPIRED`。
      operationId: exportCharacter
      parameters:
        - name: download_type
          in: query
          required: false
          description: 选择要填充的签名输出 URL。提取就绪后使用 `vsplat`；仅查询状态或获取缩略图时省略。
          schema:
            type: string
            enum:
              - vsplat
      responses:
        '200':
          description: 当前 vsplat 导出状态。
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CharacterExport'
        '400':
          $ref: '#/components/responses/ResourceBadRequest'
        '401':
          $ref: '#/components/responses/ResourceUnauthorized'
        '404':
          $ref: '#/components/responses/ResourceNotFound'
        '500':
          $ref: '#/components/responses/ResourceInternalServerError'
        '503':
          $ref: '#/components/responses/ResourceServiceUnavailable'
components:
  parameters:
    CharacterId:
      name: character_id
      in: path
      required: true
      description: 角色创建或列表接口返回的公开 Character ID。通常以 `char_` 开头，且必须是调用方拥有的角色。
      schema:
        type: string
        minLength: 1
      example: char_2f1c4b8e-9d7a-4f2a-b6c3-d5e7f9a1b3c5
    RequestId:
      name: X-Request-Id
      in: header
      required: false
      description: 可选，调用方提供的关联 ID，会原样回显在响应头中。不传则由服务生成。用于链路追踪和技术支持。
      schema:
        type: string
        minLength: 1
  headers:
    RequestId:
      description: 用于技术支持和链路追踪的稳定请求标识。
      schema:
        type: string
  schemas:
    CharacterExport:
      description: >
        角色的 vsplat 提取结果，用于下载。`vsplat_url` 仅在请求携带 `download_type=vsplat`
        时填充。`thumbnail_url` 无条件提供——它是提取的默认输出，只要渲染了缩略图就会填充，与 `download_type`
        无关。下载链接有效期 1 小时，每次读取都会重新签名。原名 `AvatarResource`，由现已移除的 `GET
        /v1/avatars/{avatar_id}` 返回。
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - download_type
        - vsplat_url
        - thumbnail_url
        - created_at
        - updated_at
        - error
      properties:
        id:
          type: string
          description: 该 vsplat 导出所属角色的 ID。
          minLength: 1
        status:
          description: vsplat 提取当前的生命周期。仅当其为 `ready` 且 `vsplat_url` 已填充时再下载。
          allOf:
            - $ref: '#/components/schemas/ResourceStatus'
        download_type:
          description: 回显请求的 `download_type`；`vsplat` 表示返回签名资产链接，null 表示未明确请求可下载的产物。
          type: string
          nullable: true
          enum:
            - vsplat
            - null
        vsplat_url:
          type: string
          description: >-
            `.vsplat` 资产的签名链接（有效期 1 小时），在 `download_type=vsplat` 且提取已就绪时提供；否则为
            null。
          nullable: true
        thumbnail_url:
          type: string
          description: 标准提取缩略图的签名链接（有效期 1 小时），在生成了缩略图时提供；与 `download_type` 无关，否则为 null。
          nullable: true
        created_at:
          description: 带 UTC 偏移的 ISO 8601 时间戳。对于尚未记录该时间的任务，可能为空字符串。
          type: string
          nullable: true
        updated_at:
          type: string
          description: 最近一次提取状态更新的时间戳（ISO 8601，带 UTC 偏移）；不可用时为 null。
          nullable: true
        error:
          type: object
          description: '`status` 为 `failed` 时的结构化提取失败信息；否则为 null。'
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ResourceError'
    ResourceStatus:
      description: |
        所有异步资源共用的公开生命周期。取值与 `RenderStatus` 相同。
      type: string
      enum:
        - queued
        - processing
        - ready
        - failed
        - cancelled
    ResourceError:
      description: >
        角色或动作导出附带的失败信息。`code` 是 Viggle 内部的原始任务代码，不属于公开的 `ErrorCode`
        取值：请将其视为不透明值。没有 `retryable` 标志；请将该失败视为不可重试，并携带资产 ID 联系技术支持。
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - request_id
      properties:
        code:
          type: string
          description: 提取任务的内部失败代码，不透明。取值范围不固定。
          minLength: 1
        message:
          type: string
          description: 人类可读的提取失败说明。
        request_id:
          type: string
          description: 返回该错误的导出请求的 ID（每次读取都会变化），而非创建该资产的请求的 ID；不可用时为 null。
          nullable: true
    ResourceErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          description: 错误负载，包含稳定的错误代码、消息、重试建议、关联 ID 以及特定于该错误的详情。
          allOf:
            - $ref: '#/components/schemas/ErrorBody'
    ErrorBody:
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - retryable
        - request_id
        - details
        - remediation
      properties:
        code:
          description: 稳定的机器可读错误代码。请据此进行程序化处理，而不要解析 `message`。
          allOf:
            - $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: 人类可读的说明，适合写入日志或展示给开发者。
        retryable:
          type: boolean
          description: 不修改输入直接重试该操作是否可能成功。HTTP 408、429 和 5xx 响应为 true。
        request_id:
          type: string
          description: 用于追踪和技术支持的关联标识符。报告失败时请附上。
        details:
          type: object
          description: 特定于该错误的结构化上下文；可用的键取决于 `code`。
          additionalProperties: true
        remediation:
          description: 建议的恢复操作及可选的重试延迟。
          allOf:
            - $ref: '#/components/schemas/ErrorRemediation'
    ErrorCode:
      description: >
        API 返回的错误代码，出现在同步错误信封以及失败任务的 `error` 对象中。客户端应能容忍此处未列出的代码。没有公开映射的异步失败会以
        `PROCESSING_FAILED` 呈现。
      type: string
      enum:
        - INVALID_REQUEST
        - UNAUTHENTICATED
        - INVALID_CREDENTIAL
        - INSUFFICIENT_CREDITS
        - RENDER_NOT_FOUND
        - CHARACTER_NOT_FOUND
        - MOTION_NOT_FOUND
        - DRAFT_NOT_FOUND
        - NOT_FOUND
        - RESULT_EXPIRED
        - IDEMPOTENCY_KEY_REUSED
        - ID_ALREADY_EXISTS
        - UPLOAD_TIMEOUT
        - CONTENT_POLICY_VIOLATION
        - RATE_LIMITED
        - SERVICE_BUSY
        - INTERNAL_ERROR
        - IMAGE_REQUIRED
        - MOTION_VIDEO_REQUIRED
        - UNSUPPORTED_MEDIA
        - VIDEO_TOO_LONG
        - VIDEO_TOO_LARGE
        - VIDEO_RESOLUTION_TOO_HIGH
        - VIDEO_UNREADABLE
        - VIDEO_DIMENSIONS_MUST_BE_EVEN
        - VIDEO_INACCESSIBLE
        - NO_HUMANS_DETECTED
        - MOTION_NOT_READY
        - MOTION_MODEL_MISMATCH
        - INVALID_BACKGROUND_MODE
        - ALL_WORKERS_BUSY
        - WORKER_STOPPED
        - TASK_FAILED
        - PROCESSING_FAILED
    ErrorRemediation:
      type: object
      additionalProperties: false
      required:
        - action
        - retry_after_ms
      properties:
        action:
          type: string
          enum:
            - none
            - retry
          description: 建议的下一步操作。同步错误始终为 `none`；失败任务的 `error` 在失败可重试时为 `retry`。
        retry_after_ms:
          type: integer
          description: 重试前建议等待的毫秒数；不建议定时重试时为 null。
          nullable: true
          format: int64
          minimum: 0
  responses:
    ResourceBadRequest:
      description: |
        请求无效。资源类接口对所有请求格式错误都返回 `400`，从不返回 `422`。
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceUnauthorized:
      description: 缺少 API 密钥或 API 密钥无效。错误码 `UNAUTHENTICATED`。
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceNotFound:
      description: >
        资源不存在，或对调用方不可见（其他账户的 2D 资产，或由其他 API 密钥创建的仅 3D 资产或导出）。这几种情况刻意不作区分。错误码为
        `CHARACTER_NOT_FOUND`、`MOTION_NOT_FOUND` 或
        `RENDER_NOT_FOUND`；文件已被删除的导出返回 `RESULT_EXPIRED`。
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceInternalServerError:
      description: 服务器意外错误。
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
    ResourceServiceUnavailable:
      description: 服务暂时不可用。
      headers:
        Retry-After:
          schema:
            type: integer
            minimum: 0
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ResourceErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >
        以 `Authorization: Bearer <API key>` 的形式发送 API 密钥。密钥以 `sk-`
        开头。缺少密钥或密钥无效时返回 `401 UNAUTHENTICATED`。切勿在浏览器代码中暴露 API 密钥。

````

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