Skip to main content

Introduction

Flux is an AI image service provided by Ace Data Cloud, powered by the Black Forest Labs Flux image generation model. Through the unified API of Ace Data Cloud, you can quickly call Flux using cURL to achieve text-to-image generation, image editing, multiple models, custom sizes, and more.

Prerequisites

  • Have an Ace Data Cloud account and obtain an API Token
  • Terminal environment with cURL installed

Basic Usage

The main endpoint for calling the Flux API is:
POST https://api.acedata.cloud/flux/images
This example uses the flux-pro-1.1 model.
Available models include: flux-dev, flux-pro, flux-pro-1.1, flux-pro-1.1-ultra, flux-kontext-pro, flux-kontext-max.
Complete cURL command example:
curl -X POST https://api.acedata.cloud/flux/images \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "generate", "prompt": "A white siamese cat sitting on a windowsill", "model": "flux-pro-1.1", "size": "1024x1024"}'
Please replace YOUR_API_TOKEN with the actual Token you obtained from the Ace Data Cloud platform.

Response Example

A successful call returns data in JSON format, for example:
{
  "status": "success",
  "data": {
    ...
  }
}

Processing Response with jq

It is recommended to use the jq tool for formatted output:
curl -s -X POST https://api.acedata.cloud/flux/images \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "generate", "prompt": "A white siamese cat sitting on a windowsill", "model": "flux-pro-1.1", "size": "1024x1024"}' | jq .

Error Handling

Common error codes:
Status CodeDescription
401Authentication failed, please check your API Token
403Insufficient balance or no access rights
429Request rate limit exceeded
500Internal server error

Next Steps