AirCubeAirCube
Guides

Image Generation

Generate and edit images with the AirCube API.

Available image models

Model slugDisplay nameTasks
seedream-v5.0-proSeedream 5.0 Protext-to-image
gpt-image-2GPT Image 2text-to-image
flux-1.1Flux 1.1text-to-image
flux-2-kleinFlux 2 Kleintext-to-image
qwen-imageQwen Image 2.0text-to-image
qwen-image/edit-2511Qwen Image Edit 2511image-editing
recraft-v3Recraft V3text-to-image
ideogram-v3Ideogram V3text-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:

ValueUse case
1:1Square — social media posts, avatars
16:9Landscape — blog headers, presentations
9:16Portrait — stories, mobile wallpapers
4:3Standard — general purpose
3:4Portrait — posters

resolution

Specify an exact output resolution instead of an aspect ratio:

{ "resolution": "1024x1024" }

quality

Controls the quality/detail level:

ValueDescription
lowFaster generation, lower detail
mediumBalanced speed and quality
highHighest 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:

ValueDescription
pngLossless, larger file size
jpegLossy compression, smaller file size
webpModern format, good compression

On this page