Upload Assets
November 17, 2025
Table of contents
Upload assets to Google Flow. Currently supported formats are PNG and JPEG with a maximum file size of 20 MB.
| Content-Type | File Extension |
|---|---|
| image/png | png |
| image/jpeg | jpeg |
POST raw content using Make.com and similar nocode tools.
https://api.useapi.net/v1/google-flow/assets/
Request Headers
Authorization: Bearer {API token}
Content-Type: select from the table above
API tokenis required, see Setup useapi.net for details.Content-Typeis required, see table above.
Path Parameters
-
emailis optional. The email address of the Google Flow account to use (URL-encoded if necessary).When only one account is configured, the API will automatically use that account.
With multiple accounts configured, omitting the email parameter triggers automatic load balancing based on image generation job statistics to select the healthiest account.
Note: The endpoint can be called as either
POST /assets(no email) orPOST /assets/:email(explicit email).
Request Body
Binary image content (raw bytes).
Responses
-
Image uploaded successfully. Returns the media generation ID with reference ID, image dimensions, and the account email used.
{ "mediaGenerationId": { "mediaGenerationId": "...redacted..." }, "width": 685, "height": 900, "email": "jo***@gmail.com" }mediaGenerationId.mediaGenerationId- Reference ID for use in subsequent API calls (format:user:{userid}-email:{hex_encoded_email}-image:{internal_media_id})width- Image width in pixelsheight- Image height in pixelsemail- Account email that was used for the upload (useful when email was omitted and auto-selected via load balancing)
-
Invalid request (empty content, unsupported content type, file too large, or content policy violation).
General error:
{ "error": "File size (25165824) is over 20971520 bytes" }Content policy error:
{ "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "PUBLIC_ERROR_TRUMP_FACE_DETECTED" } ] } } -
Invalid API token.
{ "error": "Unauthorized" } -
Account not found or not configured.
{ "error": "Google Flow account [email protected] not found" } -
Rate limit or quota exhausted (concurrency limit or account quota reached). Wait 5-10 seconds and retry. If this persists, you may need to cool this account off for a few hours before trying again.
{ "error": { "code": 429, "message": "Resource has been exhausted (e.g. check quota).", "status": "RESOURCE_EXHAUSTED", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "PUBLIC_ERROR_USER_REQUESTS_THROTTLED" } ] } } -
Google session refresh failed. The account needs to be reconfigured. Delete the account using DELETE /accounts/
emailand add it again by strictly following the procedure in Setup Google Flow.{ "error": "Failed to refresh session: 500 Internal Server Error" }
Model
{
mediaGenerationId: {
mediaGenerationId: string // Reference ID: user:{userid}-email:{hex_encoded_email}-image:{internal_media_id}
}
width: number // Image width in pixels
height: number // Image height in pixels
email: string // Account email used for upload
error?: string | { // Error: string (useapi.net) or object (Google API)
code: number
message: string
status: string
details: Array<{
'@type': string
reason: string
}>
}
}
Examples
-
# Option 1: Without email (auto-selection/load balancing) 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/google-flow/assets" # Option 2: With specific email 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/google-flow/assets/john%40gmail.com" -
const token = 'YOUR_API_TOKEN'; // Option 1: Without email (auto-selection/load balancing) const apiUrl = 'https://api.useapi.net/v1/google-flow/assets'; // Option 2: With specific email // const email = '[email protected]'; // const apiUrl = `https://api.useapi.net/v1/google-flow/assets/${encodeURIComponent(email)}`; // Load image - Example 1: Fetch from URL const imageUrl = "https://upload.wikimedia.org/wikipedia/commons/7/7d/Mona_Lisa_color_restoration.jpg"; const responseImage = await fetch(imageUrl); const blob = await responseImage.blob(); // Load image - Example 2: From local file (Node.js) // const fsp = require('fs').promises; // const imageFileName = "./cat.png"; // const blob = new Blob([await fsp.readFile(imageFileName)]); // Load image - Example 3: From file input element // // <input id="image-file" type="file"> // 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('Reference ID:', result.mediaGenerationId.mediaGenerationId); console.log('Account used:', result.email); -
import requests from urllib.parse import quote token = 'YOUR_API_TOKEN' # Option 1: Without email (auto-selection/load balancing) api_url = 'https://api.useapi.net/v1/google-flow/assets' # Option 2: With specific email # email = '[email protected]' # api_url = f'https://api.useapi.net/v1/google-flow/assets/{quote(email)}' # Load image - Example 1: Fetch 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 # Load image - Example 2: From local file # image_file_path = "./image.jpg" # with open(image_file_path, '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('Reference ID:', result.get('mediaGenerationId', {}).get('mediaGenerationId')) print('Account used:', result.get('email'))