Skip to main content
POST
/
api
/
open-api
/
v1
/
files
/
upload
Upload File
curl --request POST \
  --url https://www.jimmyai.cn/api/open-api/v1/files/upload \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file'
{
  "code": 20000,
  "msg": "ok",
  "data": {
    "url": "https://cdn.example.com/openapi/upload/20240628/abc123.jpg",
    "filename": "photo.jpg",
    "size": 102400,
    "mime_type": "image/jpeg"
  }
}
Upload an image, video, or audio file and receive a publicly accessible URL. Use the returned URL as reference media in video generation, image editing, and other API endpoints.
Maximum file size is 100 MB. The form field name must be file, sent as multipart/form-data.

Supported formats

TypeExtensions
Image.jpg .jpeg .png .gif .webp .bmp .svg
Video.mp4 .mov .avi .webm .mkv .m4v .flv
Audio.mp3 .wav .aac .m4a .flac .ogg

Common use cases

Use the returned url in other OpenAPI endpoints, for example:

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
file
file
required

File to upload. Field name must be file.

Response

200 - application/json

Upload successful

code
integer
Example:

20000

msg
string
Example:

"ok"

data
object
Example:
{
  "url": "https://cdn.example.com/openapi/upload/20240628/abc123.jpg",
  "filename": "photo.jpg",
  "size": 102400,
  "mime_type": "image/jpeg"
}