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

# 生成上传签名 URL

> 接口说明：生成用于直传对象存储的签名 URL，上传路径按用户与资源类型自动生成。



## OpenAPI

````yaml /openapi/zh/aitoearn.openapi.json post /api/assets/uploadSign
openapi: 3.0.1
info:
  title: AiToEarn 开放平台 API
  description: AiToEarn 开放平台 API，支持在中国站与国际站之间切换调试。业务是否成功以响应体 code === 0 为准。
  version: 1.0.0
  contact: {}
servers:
  - url: https://aitoearn.cn
    description: 中国站
  - url: https://aitoearn.ai
    description: 国际站
security: []
tags:
  - name: AI 服务
  - name: AI 服务/视频生成
  - name: AI 服务/图像生成
  - name: AI 服务/模型中转
  - name: 渠道管理
  - name: 渠道管理/账号
  - name: 渠道管理/内容发布
  - name: 渠道管理/平台
  - name: 渠道管理/互动
  - name: 渠道管理/作品
  - name: 渠道管理/账号分组
  - name: 渠道管理/授权
  - name: 资源管理
paths:
  /api/assets/uploadSign:
    post:
      tags:
        - 资源管理
      summary: 生成上传签名 URL
      description: 接口说明：生成用于直传对象存储的签名 URL，上传路径按用户与资源类型自动生成。
      operationId: AssetsHttpController_createUploadSign
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  description: 文件名（带扩展名）
                type:
                  default: temp
                  description: 资源类型
                  type: string
                  enum:
                    - aiImage
                    - aiVideo
                    - aiCard
                    - aiChatImage
                    - aideoOutput
                    - videoEdit
                    - dramaRecap
                    - styleTransfer
                    - imageEdit
                    - subtitle
                    - userMedia
                    - userFile
                    - publishMedia
                    - avatar
                    - agentSession
                    - videoThumbnail
                    - googlePlace
                    - brandLibrary
                    - temp
                size:
                  description: 文件大小（字节）
                  type: number
              required:
                - filename
            examples: {}
        required: true
      responses:
        '200':
          description: 请求已被服务处理。业务是否成功以响应体 code === 0 为准。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/UploadResultVo'
                  code:
                    type: integer
                    description: 业务状态码。0 表示成功，非 0 表示业务错误。
                  message:
                    type: string
                    description: 响应消息。
                  requestId:
                    type: string
                    description: 请求 ID。
                  timestamp:
                    type: integer
                    description: 错误响应时间戳，Unix 毫秒。
                required:
                  - code
                  - message
              examples:
                success:
                  summary: 成功
                  value:
                    code: 0
                    message: 请求成功
                    data:
                      id: string
                      path: string
                      url: string
                      uploadUrl: string
                      uploadFields: {}
                validationFailed10002:
                  summary: ValidationFailed (10002)
                  value:
                    code: 10002
                    message: 参数验证失败
                    data: {}
                    timestamp: 1772099056662
                unauthorized401:
                  summary: 未认证或 API Key 无效
                  value:
                    code: 401
                    message: Unauthorized
                    data: {}
                    timestamp: 1772099056662
                assetTooLarge12752:
                  summary: AssetTooLarge (12752)
                  value:
                    code: 12752
                    message: 资源过大
                    data: {}
                    timestamp: 1772099056662
      deprecated: false
      security:
        - apikey-header-X-Api-Key: []
components:
  schemas:
    UploadResultVo:
      type: object
      properties:
        id:
          type: string
          description: ID 编号
        path:
          type: string
          description: 资源路径
        url:
          type: string
          description: 资源 URL
        uploadUrl:
          type: string
          description: 上传 URL
        uploadFields:
          type: object
          additionalProperties:
            type: string
          properties: {}
          description: 上传表单
      required:
        - id
        - path
        - url
  securitySchemes:
    apikey-header-X-Api-Key:
      type: apiKey
      in: header
      name: X-Api-Key
      description: AiToEarn Open Platform API Key。

````