Upload asset to LTX Studio

June 3, 2025

Table of contents

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

This endpoint uploads an asset (image, video, audio, or other file) to your LTX Studio account.

https://api.useapi.net/v1/ltxstudio/assets/?…

Request Headers
Authorization: Bearer {API token}
Content-Type: {file MIME type}
  • API token is required, see Setup useapi.net for details.
  • Content-Type is required, specify the MIME type of the file being uploaded
Query Parameters
Request Body

Binary file content (image, video, audio, or other media file).

Responses
  • 200 OK

    {
        "assetUrl": "https://storage.googleapis.com/lt-infinity-prd/artifacts/user-uploads/…",
        "expirationDateString": "1748919477350",
        "asset": {
            "type": "image",
            "fileId": "asset:3b18…-type:image/png",
            "mimeType": "image/png"
        }
    }
    
  • 400 Bad Request

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

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
    assetUrl?: string
    expirationDateString?: string
    asset?: {
        type: string
        fileId: string
        mimeType: string
    }
    message?: string
    error?: string
    statusCode?: number
}
Examples
  • curl "https://api.useapi.net/v1/ltxstudio/assets/[email protected]&type=image" \
       -H "Authorization: Bearer …" \
       -H "Content-Type: image/png" \
       --data-binary @image.png
    
  • const token = "API token";
    const email = "[email protected]";
    const file = document.getElementById('fileInput').files[0];
    const apiUrl = `https://api.useapi.net/v1/ltxstudio/assets/?email=${email}&type=image`;
    
    const response = await fetch(apiUrl, {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${token}`,
        "Content-Type": file.type,
      },
      body: file
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    email = "[email protected]"
    apiUrl = "https://api.useapi.net/v1/ltxstudio/assets/"
    headers = {
        "Authorization" : f"Bearer {token}",
        "Content-Type": "image/png"
    }
    params = {
        "email": email,
        "type": "image"
    }
    with open("image.png", "rb") as f:
        response = requests.post(apiUrl, headers=headers, params=params, data=f)
    print(response, response.json())
    
Try It