Upload a file

June 3, 2026 (December 2, 2026)

Table of contents

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

Upload a reference image or audio file. The file is sent as the raw request body, with its MIME type in the Content-Type header (no multipart, no form fields). Returns an encoded asset ID you can pass to POST /music (refImage1 to refImage10, refAudio1 to refAudio10).

https://api.useapi.net/v1/flowmusic/files?email=email&stripMetadata=stripMetadata

Request Headers

Authorization: Bearer {API token}
Content-Type: image/jpeg
# Or the file's own type: image/jpg, image/png, image/webp, audio/mpeg, audio/mp3, audio/wav, audio/x-wav, audio/mp4, audio/x-m4a, audio/m4a, audio/aac
  • API token is required. Setup useapi.net shows where to get it.
  • Content-Type is required. Send the image/… or audio/… type that matches the file.

Parameters

The request body is the file itself, its raw bytes. email and stripMetadata go in the query string.

  • email is optional. The account to upload to. A song that uses the file runs on this account.
  • stripMetadata is optional. true strips AI-provenance and EXIF metadata from an image before the upload, because Google Flow Music refuses images that declare AI provenance. false keeps the bytes as they are.
    Default: true.
  • file is required. The file’s raw bytes with its MIME type as Content-Type: jpeg, png or webp images up to 20 MB, mp3, wav, m4a or aac audio up to 40 MB.

Responses

  • 200 OK

    The uploaded file: its asset id id, its link url and the account that holds it. Send the id as a refImage or refAudio of POST /music.

    {
      "id": "user:[email protected]:02b3ed31-4d0f-485e-9c82-7bade90a0c10",
      "url": "https://storage.googleapis.com/producer-app-public/producer/02b3ed31-4d0f-485e-9c82-7bade90a0c10",
      "kind": "image",
      "assetType": "image",
      "email": "[email protected]",
      "metadata_stripped": false
    }
    
  • 400 Bad Request

    The request itself is wrong, or no usable Google Flow Music account is added. The error text says what to change.

    {
      "error": "request body is empty (send the file bytes as the raw body)",
      "code": 400
    }
    
    {
      "error": "No healthy Google Flow Music accounts available",
      "code": 400
    }
    
    {
      "error": "Please configure at least one account at https://useapi.net/docs/api-flowmusic-v1/post-flowmusic-accounts",
      "code": 400
    }
    
    {
      "error": "Invalid JSON: Unexpected token 'o', \"not json\" is not valid JSON",
      "code": 400
    }
    
  • 401 Unauthorized

    The useapi.net API token is missing or wrong.

    A step at Google Flow Music failed with 401: it refused the account’s sign-in. The error text names the step.

    {
      "error": "Upload failed (HTTP 401): Upstream returned an error with an unreadable body (connection closed before the body arrived).",
      "code": 401
    }
    
    {
      "error": "useapi.net ⁝ Unauthorized",
      "code": 401
    }
    
  • 402 Payment Required

    The useapi.net subscription is not active.

    {
      "error": "useapi.net ⁝ Your account has no subscription, please subscribe to our services before submitting requests",
      "code": 402
    }
    
  • 404 Not Found

    The account, job or clip does not exist, or is no longer there.

    {
      "error": "Account [email protected] not found",
      "code": 404
    }
    
  • 413 Content Too Large

    The file is too large. Images can be up to 20 MB, audio up to 40 MB.

    {
      "error": "upload exceeds 40 MB cap (got 52428800 bytes)",
      "code": 413
    }
    
    {
      "error": "audio exceeds 40 MB cap (got 52428800 bytes)",
      "code": 413
    }
    
  • 422 Unprocessable Content

    Google Flow Music made nothing, or refused the input. The error text says why.

    {
      "error": "Image declares AI-generated provenance metadata (IPTC DigitalSourceType: trainedAlgorithmicMedia), which Google Flow Music's upload edge rejects. Remove ?stripMetadata=false to let us strip it, or re-save the image without metadata.",
      "code": 422
    }
    
  • 429 Too Many Requests

    Google Flow Music refused the request because this account sent too many at once. Retry once a running generation finishes, or a little later.

    {
      "error": "Upload failed (HTTP 429): Upstream returned an error with an unreadable body (connection closed before the body arrived).",
      "code": 429
    }
    
  • 500 Internal Server Error

    Something failed on our side.

    A step at Google Flow Music failed with 500. The error text names the step.

    {
      "error": "Cannot read properties of undefined (reading 'email')",
      "code": 500
    }
    
    {
      "error": "Upload failed (HTTP 500): Upstream returned an error with an unreadable body (connection closed before the body arrived).",
      "code": 500
    }
    
  • 502 Bad Gateway

    Google Flow Music answered with an error, or did not answer. The error text says what happened.

    {
      "error": "Google Flow Music upload returned an unreadable/empty body",
      "code": 502
    }
    
    {
      "error": "Upstream network failure after 4 attempts: Network connection lost.",
      "code": 502
    }
    
    {
      "error": "Upstream fetch produced no response",
      "code": 502
    }
    
  • 503 Service Unavailable

    The Google Flow Music sign-in service did not answer, or another request is renewing the account’s sign-in right now. The account is unchanged. Retry in a minute, or after Retry-After when it is sent. On any call, it can also mean our service was busy for a moment.

    {
      "error": "Another request is refreshing the Google Flow Music sign-in of [email protected] right now. Retry in a few seconds.",
      "code": 503
    }
    
    {
      "error": "Google Flow Music's sign-in service did not answer (500). Retry in a minute.",
      "code": 503
    }
    
  • 596 Account Error

    The account is in an error state. Add it again with POST /accounts.

    {
      "error": "Account [email protected] in error state: Google Flow Music signed out [email protected]: its sign-in can no longer be refreshed (refresh_token_already_used), usually because it was refreshed somewhere else. Add the account again: https://useapi.net/docs/start-here/setup-flowmusic",
      "code": 596
    }
    
    {
      "error": "Google Flow Music signed out [email protected]: its sign-in can no longer be refreshed (refresh_token_already_used), usually because it was refreshed somewhere else. Add the account again: https://useapi.net/docs/start-here/setup-flowmusic",
      "code": 596
    }
    

Model

The uploaded file’s asset id, to pass to POST /music as a reference, with its storage URL and kind (image or audio).

The uploaded file
{ // TypeScript, fields marked ? may be absent
  id: string  // the encoded asset id, `user:[email protected]:<uuid>` (or -audio:): use it as refImage or refAudio in POST /music
  url: string  // the file on Google Flow Music's storage
  kind: "image" | "audio"  // image or audio
  assetType: "image" | "audio"  // image or audio, the same as kind
  email: string  // the Google Flow Music account that holds the file
  metadata_stripped?: boolean  // images only: true when AI-provenance metadata was stripped before the upload
  clip_id?: string | null  // audio only: the clip Google Flow Music made of the upload
  operation_id?: string | null  // audio only: Google Flow Music's upload operation
  is_flagged?: boolean | null  // audio only: true when Google Flow Music flagged the audio
  duration_s?: number | null  // audio only: the length in seconds
}

Examples

  • curl -X POST "https://api.useapi.net/v1/flowmusic/files" \
         -H "Authorization: Bearer YOUR_API_TOKEN" \
         -H "Content-Type: image/jpeg" \
         --data-binary @example.jpg
    
  • import { readFile } from 'node:fs/promises'
    
    const response = await fetch('https://api.useapi.net/v1/flowmusic/files', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_TOKEN',
        'Content-Type': 'image/jpeg'
      },
      body: await readFile('example.jpg')
    })
    console.log(response.status, await response.json())
    
  • import requests
    
    response = requests.post(
        'https://api.useapi.net/v1/flowmusic/files',
        headers={'Authorization': 'Bearer YOUR_API_TOKEN', 'Content-Type': 'image/jpeg'},
        data=open('example.jpg', 'rb').read(),
    )
    print(response.status_code, response.json())
    

Try It