Upload image, audio, or video file

October 15, 2024 (May 4, 2026)

Table of contents

  1. Request Headers
  2. Query Parameters
  3. Responses
  4. Model
  5. Examples
  6. Try It

Use hailuoai.video account to upload image, see Setup MiniMax for details.

Upload media (images, audio, video) up to 5GB in size that you want to use as references in POST videos/create or POST images/create.

Supported formats:

  • Images (.png, .jpeg, .webp) — first frame, end frame, character/subject reference, omni image reference. .webp uploads via Content-Type: image/jpeg.
  • Audio (.mp3, .wav) — Seedance omni audio references (audioFileID1audioFileID3, resolved as @Audio1@Audio3).
  • Video (.mp4) — Seedance omni video references (videoFileID1videoFileID3, resolved as @Video1@Video3).

Please be patient, on average, it takes about 1 minute per GB to upload.

POST raw content using Make.com and similar nocode tools.

https://api.useapi.net/v1/minimax/files/?…

Request Headers
Authorization: Bearer {API token}
Content-Type: select from the table below
  • API token is required, see Setup useapi.net for details.
  • Content-Type is required, select from the table below:
Content-Type File Extension Used for
image/png png Image references (all video/image models)
image/jpeg jpeg Image references; also .webp (uploaded as jpeg)
audio/mpeg mp3 Seedance omni audio reference (audioFileID*)
audio/wav wav Seedance omni audio reference (audioFileID*)
video/mp4 mp4 Seedance omni video reference (videoFileID*)
Query Parameters
  • account is optional when only one account configured. However, if you have multiple accounts configured, this parameter becomes required.
Responses
  • 200 OK

    {
        "ossPath": "<file url>",
        "fileID": "user:user_id-minimax:account-file:file_id"
    }
    
  • 400 Bad Request

    {
        "error": "<Error message>",
        "code": 400
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
  ossPath: string
  fileID: string
  error: string
  code: number
}
Examples
  • curl "https://api.useapi.net/v1/minimax/files/?account=account" \
      -H "Authorization: Bearer …" \
      -H "Content-Type: image/jpeg" \
      --data-binary /path/to/your/image.jpeg
    
  • const token = "API token";
    const account = "Previously configured video account"; 
    const apiUrl = `https://api.useapi.net/v1/minimax/files/?account=${account}`; 
    let blob;
    /*
        // Example 1: Fetch image from URL
        const imageUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7d/Mona_Lisa_color_restoration.jpg";
        const responseImage = await fetch(imageUrl);
        blob = await responseImage.blob();
    */
    /* 
        // Example 2: Load image from local file (Blob)
        const fsp = require('fs').promises;
        const imageFileName = "./cat.png";
        blob = new Blob([await fsp.readFile(imageFileName)]);
    */
    /*
        // Example 3: Load from input file html element
        // <input id="image-file" type="file"> 
        const imageFile = document.getElementById(`image-file`);
        if (imageFile.files[0])
            blob = imageFile.files[0]);
    */
    const response = await fetch(apiUrl, {
      method: "POST"
      headers: {
        "Authorization": `Bearer ${token}`,
      },
      body: blob
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    account = "Previously configured video account"
    apiUrl = f"https://api.useapi.net/v1/minimax/files/?account={account}"
    headers = {
        'Authorization': f'Bearer {token}',
        'Content-Type': 'image/jpeg'
    }
    
    # # Example 1: Fetch image from URL
    # image_url = "https://upload.wikimedia.org/wikipedia/commons/7/7d/Mona_Lisa_color_restoration.jpg"
    # response_image = requests.get(image_url)
    # file_content = response_image.content
    
    # # Example 2: Load image from local file
    # image_file_path = "./image.jpg"
    # with open(image_file_path, 'rb') as image_file:
    #     file_content = image_file.read()
    
    response = requests.post(api_url, headers=headers, data=file_content)
    print(response, response.json())
    
Try It

Please be patient, comrades are checking every byte of your file for illegal propaganda, so give them some time.