Generate an AI image

June 3, 2026

Table of contents

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

Generate an AI image from a text prompt. Returns an encoded image asset ID β€” the same shape POST /files returns for an uploaded image β€” that you can pass as a reference image (refImage1…) to POST /music.

https://api.useapi.net/v1/flowmusic/files/generate

Request Headers

Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data

Request Body

{ "prompt": "abstract neon city skyline at night" }
  • email is optional, which configured account to use.
  • prompt is required, the image description. 1–2,000 characters.

Responses

  • 200 OK

    {
      "id": "user:[email protected]:...",
      "url": "https://storage.googleapis.com/producer-app-public/assets/....jpg",
      "kind": "image",
      "assetType": "image",
      "email": "[email protected]",
      "width": 1024,
      "height": 1024,
      "model": "google-generative-ai"
    }
    
  • 400 β€” missing/empty prompt.

  • 401 Unauthorized β€” invalid API token.

  • 500 β€” Flow Music declined the request. The most common cause is a moderated or otherwise disallowed prompt: Flow Music returns a generic Internal Server Error (it does not say why) and we pass it through verbatim. Retry with a different prompt β€” if a clearly benign prompt still fails, it is likely a transient upstream error.

    {
      "error": "FlowMusic image generation failed (500): \"Internal Server Error\"",
      "code": 500
    }
    
  • 596 Account Error

    The account targeted by email is in an error state and can’t be used β€” re-add it via POST /accounts. The error field returns whatever reason was recorded for the account.

    {
      "error": "Account [email protected] in error state: refresh token rejected",
      "code": 596
    }
    

Model

{
  id: string                       // encoded image asset id β€” usable as refImage1… in POST /music
  url: string
  kind: 'image'
  assetType: 'image'
  email: string
  width: number
  height: number
  model: string                    // the image model, e.g. 'google-generative-ai'
}

Examples

  • curl -H "Content-Type: application/json" \
         -H "Authorization: Bearer YOUR_API_TOKEN" \
         -X POST "https://api.useapi.net/v1/flowmusic/files/generate" \
         -d '{ "prompt": "abstract neon city skyline at night" }'
    
  • import requests
    response = requests.post(
        'https://api.useapi.net/v1/flowmusic/files/generate',
        headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
        json={'prompt': 'abstract neon city skyline at night'}
    )
    print(response.status_code, response.json())
    

Try It