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

# 上传文件

> 上传图片、视频或音频文件，返回可公网访问的文件 URL。单文件最大 100 MB。

将图片、视频或音频文件上传至服务器，获取可公网访问的 URL，用于视频生成、图片编辑等接口的参考素材。

<Note>
  单文件大小不超过 **100 MB**。字段名固定为 `file`，使用 `multipart/form-data` 格式。
</Note>

## 支持格式

| 类型 | 扩展名                                                |
| -- | -------------------------------------------------- |
| 图片 | `.jpg` `.jpeg` `.png` `.gif` `.webp` `.bmp` `.svg` |
| 视频 | `.mp4` `.mov` `.avi` `.webm` `.mkv` `.m4v` `.flv`  |
| 音频 | `.mp3` `.wav` `.aac` `.m4a` `.flac` `.ogg`         |

## 使用场景

返回的 `url` 可直接用于其他 OpenAPI 接口，例如：

* [创建视频](/zh/api-reference/videos/create) 的 `images` 字段
* [SP 上传素材](/zh/api-reference/seedance/sp/assets-upload) 的 `url` 字段
* [图片理解](/zh/api-reference/images/understand) 的 `image_url` 字段


## OpenAPI

````yaml POST /api/open-api/v1/files/upload
openapi: 3.1.0
info:
  title: Jimmy AI OpenAPI
  description: API for Jimmy AI video generation services
  version: 1.0.0
servers:
  - url: https://www.jimmyai.cn
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/open-api/v1/files/upload:
    post:
      summary: Upload File
      description: >-
        Upload an image, video, or audio file and receive a publicly accessible
        URL. Maximum file size is 100 MB.
      operationId: uploadFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileUploadRequest'
      responses:
        '200':
          description: Upload successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadApiResponse'
              examples:
                success:
                  summary: Upload successful
                  value:
                    code: 20000
                    msg: ok
                    data:
                      url: >-
                        https://cdn.example.com/openapi/upload/20240628/abc123.jpg
                      filename: photo.jpg
                      size: 102400
                      mime_type: image/jpeg
components:
  schemas:
    FileUploadRequest:
      type: object
      required:
        - file
      properties:
        file:
          type: string
          format: binary
          description: File to upload. Field name must be `file`.
    FileUploadApiResponse:
      type: object
      properties:
        code:
          type: integer
          example: 20000
        msg:
          type: string
          example: ok
        data:
          $ref: '#/components/schemas/FileUploadData'
    FileUploadData:
      type: object
      properties:
        url:
          type: string
          description: Public URL of the uploaded file
          example: https://cdn.example.com/openapi/upload/20240628/abc123.jpg
        filename:
          type: string
          description: Original filename
          example: photo.jpg
        size:
          type: integer
          format: int64
          description: File size in bytes
          example: 102400
        mime_type:
          type: string
          description: File MIME type
          example: image/jpeg
      example:
        url: https://cdn.example.com/openapi/upload/20240628/abc123.jpg
        filename: photo.jpg
        size: 102400
        mime_type: image/jpeg
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````