Generate and edit images with GPT Image, FLUX, MAI-Image, and open-weight creative models. OpenAI-compatible endpoints.
POST https://api.agilecloud.ai/v1/images/generations # Text-to-image (JSON) POST https://api.agilecloud.ai/v1/images/edits # Edit source image(s) (multipart)
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes* | Model alias, e.g. flux-1.1-pro. *Always set it: the OpenAI default (dall-e-3) is not currently offered and returns 404. |
| prompt | string | Yes | Text description of the image (up to 32,000 characters). |
| n | integer | No | Number of images (1–10). Models that return one image per request (e.g. Kontext) reject n > 1. |
| size | string | No | WIDTHxHEIGHT, e.g. 1024x1024 (64–8192 px per side). Each model enforces its own supported sizes. |
| output_format | string | No | png, jpeg, or webp. FLUX models support png and jpeg. |
| response_format | string | No | url or b64_json. FLUX models return b64_json only (their default). Creative models default to url, which is available only where ACAI re-hosts screened images — request b64_json to be safe. |
| seed | integer | No | Reproducible sampling seed (FLUX). |
| guidance | number | No | FLUX.2 only: prompt adherence, 1.5–10. Rejected by every other model. |
| steps | integer | No | FLUX.2 only: sampling steps, 1–50. Rejected by every other model. |
| moderation | string | No | GPT Image only: auto (default) or low. Relaxes the provider's own filter; ACAI's screening and hard limits are unchanged. |
| lora | string | No | Creative models only: the id of an ACAI-curated LoRA style adapter enabled for that model. Arbitrary adapters or URLs are not accepted; other models reject this field. |
| lora_scale | number | No | Adapter strength, 0–2. Only valid with lora. |
quality and style are accepted for OpenAI compatibility. GPT Image honours quality; FLUX and MAI-Image ignore both. Edits take the same fields as multipart form data plus one or more image files; masks are not supported on FLUX or MAI-Image.
curl https://api.agilecloud.ai/v1/images/generations \
-H "Authorization: Bearer $DIRECTAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "flux-1.1-pro",
"prompt": "A futuristic cityscape at sunset with flying cars",
"size": "1024x1024",
"output_format": "png"
}'Response
{
"created": 1719000000,
"data": [
{ "b64_json": "iVBORw0KGgo..." }
]
}import base64
from openai import OpenAI
client = OpenAI(
base_url="https://api.agilecloud.ai/v1",
api_key="YOUR_API_KEY",
)
response = client.images.generate(
model="flux-1.1-pro",
prompt="A futuristic cityscape at sunset with flying cars",
size="1024x1024",
)
with open("city.png", "wb") as f:
f.write(base64.b64decode(response.data[0].b64_json))| Model | Description | Access |
|---|---|---|
| gpt-image-1.5 | OpenAI text-to-image and editing; billed on usage tokens | Pro+ |
| flux.2-pro | Black Forest Labs FLUX.2 [pro]: text-to-image and edits with up to 8 reference images | Pro+ |
| flux.2-flex | FLUX.2 [flex]: tunable guidance and steps, strong typography, up to 10 reference images | Pro+ |
| mai-image-2.6 | Microsoft photorealistic text-to-image and edits with up to 5 source images; one image per call | Pro+ |
| flux-1.1-pro | Black Forest Labs text-to-image, up to 1.6 MP | Pro+ |
| flux-kontext-pro | Text-to-image plus single-image edits via /v1/images/edits | Pro+ |
| qwen-image-2512 | Open-weight text-to-image (Apache-2.0) | Creative access |
| qwen-image-edit-2511 | Open-weight image editing (Apache-2.0) | Creative access |
| z-image-turbo | Open-weight fast text-to-image (Apache-2.0) | Creative access |
DALL-E 3 is not offered; use gpt-image-1.5. flux.2-flex and mai-image-2.6 run on Azure Global capacity, so prompts and images may be processed outside the US. See Models for creative access.