Generate an AI image

June 3, 2026 (November 16, 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:1234-user@email.com-image:...",
      "url": "https://storage.googleapis.com/producer-app-public/assets/....jpg",
      "kind": "image",
      "assetType": "image",
      "email": "user@email.com",
      "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 user@email.com in error state: refresh token rejected",
      "code": 596
    }
    

Model

The generated image’s asset id, to pass as a reference image to POST /music, with its URL, width, height and image model.

The generated image, field by field
{
  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