Skip to main content

Overview

For files that exceed the Base64 size limits or when you need better upload performance, DomoAI provides a file upload API. This allows you to:
  • Upload files up to 80 MB
  • Reuse uploaded files across multiple API calls
  • Reduce request payload size for better performance

How It Works

The upload process uses presigned URLs - a secure, two-step upload flow:
1

Request Upload URL

Call POST /v1/upload/file with your filename to get a presigned URL and domoai_uri.
2

Upload File

Upload your file directly to the presigned URL using a PUT request with the provided headers.
3

Use domoai_uri

Use the domoai_uri in subsequent API calls (e.g., Talking Avatar, Image to Video) instead of Base64 data.

Supported File Types

CategoryFormatsUse Cases
ImagesJPEG, PNG, WebP, AVIFImage to Video, Template to Video, Talking Avatar
AudioMP3, WAV, M4A, AACTalking Avatar
VideoMP4, WebM, MOVTalking Avatar

Step 1: Request Upload URL

curl -X POST "https://api.domoai.com/v1/upload/file" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "audio.mp3"
  }'

Response

{
  "code": 0,
  "message": "success",
  "data": {
    "presigned_url": "https://storage.example.com/upload/...",
    "headers": {
      "Content-Type": "audio/mpeg",
      "x-amz-acl": "private"
    },
    "domoai_uri": "domoai://eyJhbGciOiJIUzI1NiIs..."
  }
}
FieldDescription
presigned_urlThe URL to upload your file to
headersRequired headers for the upload request
domoai_uriToken to reference the uploaded file in API calls

Step 2: Upload File to Presigned URL

Use the presigned_url and headers from the previous response to upload your file:
curl -X PUT "<PRESIGNED_URL>" \
  -H "Content-Type: audio/mpeg" \
  -H "x-amz-acl: private" \
  --data-binary @audio.mp3

Step 3: Use domoai_uri in API Calls

Once uploaded, use the domoai_uri in your API requests:
curl -X POST "https://api.domoai.com/v1/video/talking-avatar" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "image": {
      "domoai_uri": "domoai://eyJhbGciOiJIUzI1NiIs..."
    },
    "audio": {
      "domoai_uri": "domoai://eyJhbGciOiJIUzI1NiIs..."
    },
    "seconds": 10
  }'

Limitations

LimitValue
Maximum file size80 MB
Minimum file size512 bytes
domoai_uri validity24 hours
domoai_uri tokens expire after 24 hours. If you need to use the same file after expiration, you must upload it again.

Input Format Reference

All media inputs support three methods:
{
  "image": {
    "bytes_base64_encoded": "iVBORw0KGgo...",  // Base64 encoded data
    "url": "https://example.com/image.jpg",     // Public URL (if supported)
    "domoai_uri": "domoai://eyJhbGci..."       // Uploaded file reference
  }
}
You only need to provide one of these fields. If multiple are provided, domoai_uri takes priority, followed by bytes_base64_encoded, then url.

Next Steps