Upload Assets

February 23, 2026

Table of contents

  1. Request Headers
  2. Path Parameters
  3. Request Body
  4. Responses
  5. Model
  6. Examples
  7. Try It

Upload images to Dreamina for use as video generation reference frames. Supported formats are JPEG, PNG, and WebP with a maximum file size of 10 MB.

Content-Type File Extension
image/jpeg jpeg, jpg
image/png png
image/webp webp

The returned imageRef is used as firstFrameRef, endFrameRef, or frame_N_imageRef in POST /videos.

https://api.useapi.net/v1/dreamina/assets/account

Request Headers

Authorization: Bearer {API token}
Content-Type: select from the table above
  • API token is required, see Setup useapi.net for details.
  • Content-Type is required, see table above.

Path Parameters

  • account is required. The account identifier in REGION:email format. Example: US:[email protected].

Request Body

Binary image content (raw bytes).

Responses

  • 200 OK

    Image uploaded successfully. Returns the imageRef for use in video generation.

    {
      "imageRef": "US:[email protected]:w685:h900:s86866-uri:tos-useast5-i-wopfjsm1ax-tx/3605b150c6b949f5acea2eac3ca59544",
      "account": "US:[email protected]",
      "width": 685,
      "height": 900,
      "size": 86866
    }
    
    • imageRef - Reference ID for use in POST /videos as firstFrameRef, endFrameRef, or frame_N_imageRef.
    • width - Image width in pixels.
    • height - Image height in pixels.
    • size - Image size in bytes.
    • account - Account used for the upload.

    imageRef format: <REGION:email>-image:w<width>:h<height>:s<size>-uri:<nativeUri>

  • 400 Bad Request

    Invalid request (empty content, unsupported content type, or file too large).

    {
      "error": "Content-Type (image/bmp) not supported. Valid values: image/jpeg, image/png, image/webp"
    }
    
    {
      "error": "Image is empty"
    }
    
  • 401 Unauthorized

    Invalid API token.

    {
      "error": "Unauthorized"
    }
    
  • 404 Not Found

    Account not found or not configured.

    {
      "error": "Unable to find configuration for account US:[email protected]"
    }
    
  • 596 Session Error

    Account session expired. Re-add the account using POST /accounts with correct credentials.

    {
      "error": "Session expired"
    }
    

Model

{
  imageRef: string                // Reference ID for POST /videos
  account: string                 // "US:[email protected]"
  width: number                   // Image width in pixels
  height: number                  // Image height in pixels
  size: number                    // Image size in bytes
  error?: string                  // Error message
}

Examples

  • curl -X POST \
         -H "Authorization: Bearer YOUR_API_TOKEN" \
         -H "Content-Type: image/jpeg" \
         --data-binary @/path/to/your/image.jpeg \
         "https://api.useapi.net/v1/dreamina/assets/US:[email protected]"
    
  • const token = 'YOUR_API_TOKEN';
    const account = 'US:[email protected]';
    
    const apiUrl = `https://api.useapi.net/v1/dreamina/assets/${encodeURIComponent(account)}`;
    
    // Load image - Example 1: From local file (Node.js)
    const fsp = require('fs').promises;
    const blob = new Blob([await fsp.readFile('./image.jpeg')]);
    
    // Load image - Example 2: From file input element
    // const imageFile = document.getElementById('image-file');
    // const blob = imageFile.files[0];
    
    const response = await fetch(apiUrl, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': blob.type || 'image/jpeg'
      },
      body: blob
    });
    
    const result = await response.json();
    console.log('Upload result:', result);
    console.log('imageRef:', result.imageRef);
    
  • import requests
    from urllib.parse import quote
    
    token = 'YOUR_API_TOKEN'
    account = 'US:[email protected]'
    
    api_url = f'https://api.useapi.net/v1/dreamina/assets/{quote(account, safe="")}'
    
    with open('./image.jpeg', 'rb') as image_file:
        file_content = image_file.read()
    
    headers = {
        'Authorization': f'Bearer {token}',
        'Content-Type': 'image/jpeg'
    }
    
    response = requests.post(api_url, headers=headers, data=file_content)
    
    result = response.json()
    print('Upload result:', result)
    print('imageRef:', result.get('imageRef'))
    

Try It