Image Generation

Generate high-quality images using FLUX series models in GPT compatible format. FLUX is a powerful open-source image generation model supporting multiple versions.

Endpoint

POST /v1/images/generations

Authentication

All requests require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Request Parameters

ParameterTypeRequiredDescription
modelstringYesModel ID, e.g., flux-pro, flux-dev, flux-schnell
promptstringYesText description for image generation
nintegerNoNumber of images to generate, default 1
sizestringNoImage size, e.g., 1024x1024, 1024x768, 768x1024
response_formatstringNoResponse format, options: url, b64_json, default url

Available Models

ModelDescription
flux-proProfessional version, highest quality
flux-devDevelopment version, balanced quality and speed
flux-schnellFast version, fastest generation speed
flux-1.1-proFLUX 1.1 Professional version

Request Example

curl -X POST "https://api.example.com/v1/images/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "flux-pro",
    "prompt": "A surrealist cityscape with floating buildings",
    "n": 1,
    "size": "1024x1024"
  }'

Response Example

{
  "created": 1700000000,
  "data": [
    {
      "url": "https://example.com/generated-image.png"
    }
  ]
}

Response Fields

FieldTypeDescription
createdintegerCreation timestamp
dataarrayList of generated images
data[].urlstringImage URL
data[].b64_jsonstringBase64 encoded image