Guides
Image Generation
Generate and edit images with the AirCube API.
Available image models
| Model slug | Display name | Tasks |
|---|---|---|
seedream-v5.0-pro | Seedream 5.0 Pro | text-to-image |
gpt-image-2 | GPT Image 2 | text-to-image |
flux-1.1 | Flux 1.1 | text-to-image |
flux-2-klein | Flux 2 Klein | text-to-image |
qwen-image | Qwen Image 2.0 | text-to-image |
qwen-image/edit-2511 | Qwen Image Edit 2511 | image-editing |
recraft-v3 | Recraft V3 | text-to-image |
ideogram-v3 | Ideogram V3 | text-to-image |
For the full list, see the model catalog.
Text to image
Generate an image from a text prompt.
cURL
curl -X POST https://aircube.ai/api/v3/seedream-v5.0-pro/text-to-image \
-H "Authorization: Bearer $AIRCUBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "a minimalist workspace with a laptop, coffee cup, and succulent plant, natural light",
"aspect_ratio": "16:9",
"quality": "high"
}'Python
import os
import time
import requests
API_KEY = os.environ["AIRCUBE_API_KEY"]
BASE_URL = "https://aircube.ai/api/v3"
HEADERS = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
}
# Submit
response = requests.post(
f"{BASE_URL}/seedream-v5.0-pro/text-to-image",
headers=HEADERS,
json={
"prompt": "a minimalist workspace with a laptop, coffee cup, and succulent plant, natural light",
"aspect_ratio": "16:9",
"quality": "high",
},
)
generation_id = response.json()["data"]["id"]
# Poll
while True:
result = requests.get(f"{BASE_URL}/status/{generation_id}", headers=HEADERS).json()
if result["data"]["status"] == "completed":
print(result["data"]["output_url"])
break
elif result["data"]["status"] == "failed":
print("Failed")
break
time.sleep(3)JavaScript
const API_KEY = process.env.AIRCUBE_API_KEY;
const BASE_URL = "https://aircube.ai/api/v3";
const submitRes = await fetch(`${BASE_URL}/seedream-v5.0-pro/text-to-image`, {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt:
"a minimalist workspace with a laptop, coffee cup, and succulent plant, natural light",
aspect_ratio: "16:9",
quality: "high",
}),
});
const { data } = await submitRes.json();
// Poll for result
while (true) {
const pollRes = await fetch(`${BASE_URL}/status/${data.id}`, {
headers: { Authorization: `Bearer ${API_KEY}` },
});
const result = await pollRes.json();
if (result.data.status === "completed") {
console.log(result.data.output_url);
break;
} else if (result.data.status === "failed") {
throw new Error("Failed");
}
await new Promise((r) => setTimeout(r, 3000));
}Image editing
Edit an existing image with a text prompt using models that support the image-editing task.
curl -X POST https://aircube.ai/api/v3/qwen-image/edit-2511/image-editing \
-H "Authorization: Bearer $AIRCUBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "remove the background and replace it with a gradient",
"image": "https://example.com/original-photo.jpg"
}'The image field accepts any publicly accessible URL. AirCube downloads and stores the image automatically.
Parameters
aspect_ratio
Controls the output aspect ratio. Common values:
| Value | Use case |
|---|---|
1:1 | Square — social media posts, avatars |
16:9 | Landscape — blog headers, presentations |
9:16 | Portrait — stories, mobile wallpapers |
4:3 | Standard — general purpose |
3:4 | Portrait — posters |
resolution
Specify an exact output resolution instead of an aspect ratio:
{ "resolution": "1024x1024" }quality
Controls the quality/detail level:
| Value | Description |
|---|---|
low | Faster generation, lower detail |
medium | Balanced speed and quality |
high | Highest detail, slower generation |
count
Generate multiple images in a single request (1–4):
{ "prompt": "a cute robot", "count": 4 }Each image is charged separately.
output_format
Choose the output format:
| Value | Description |
|---|---|
png | Lossless, larger file size |
jpeg | Lossy compression, smaller file size |
webp | Modern format, good compression |