Generate images from a text prompt with Qubax's image generation endpoint. It mirrors the OpenAI Images API, so any client built for /v1/images/generations works unchanged when pointed at the Qubax base URL.
POST https://api.qubax.ai/v1/images/generationsAll requests require an API key passed as a Bearer token in the Authorization header:
Authorization: Bearer qbx_live_...
Content-Type: application/jsonThe request body is a JSON object with the parameters below.
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | ID of the model to use (e.g. flux-1.1-pro). |
| prompt | string | Yes | A text description of the desired image. Max 4,000 chars. |
| n | integer | No | Number of images to generate. Default 1. |
| size | string | No | Dimensions of the image, e.g. 1024x1024. Defaults vary by model. |
| response_format | string | No | Either url or b64_json. Default url. |
Qubax routes image generation through several state-of-the-art model families. The table below lists the most commonly used models.
| Model ID | Provider / Notes |
|---|---|
| flux-1.1-pro | Black Forest Labs — high quality, fast. Recommended default. |
| dall-e-3 | OpenAI — strong prompt adherence, integrated captions. |
| flux-1.1-pro-ultra | Black Forest Labs — up to 4K resolution. |
| flux-1-schnell | Black Forest Labs — fastest variant, lower fidelity. |
n value. When a combination is unsupported the API returns a 400 describing the constraint.Using the OpenAI Python SDK pointed at the Qubax base URL:
from openai import OpenAI
client = OpenAI(
api_key="qbx_live_...",
base_url="https://api.qubax.ai/v1",
)
response = client.images.generate(
model="flux-1.1-pro",
prompt="a cat in space, photorealistic",
n=1,
size="1024x1024",
)
# Default response_format is "url" — print the generated image URL
print(response.data[0].url)curl https://api.qubax.ai/v1/images/generations \
-H "Authorization: Bearer qbx_live_..." \
-H "Content-Type: application/json" \
-d '{
"model": "flux-1.1-pro",
"prompt": "a cat in space, photorealistic",
"n": 1,
"size": "1024x1024"
}'A successful request returns a JSON object with a data array. Each entry contains either a url or, when response_format is b64_json, a base64-encoded PNG string under b64_json.
{
"created": 1719792000,
"data": [
{
"url": "https://cdn.qubax.ai/images/abc123-generated.png"
}
]
}With response_format: "b64_json" the same shape returns the image inline:
{
"created": 1719792000,
"data": [
{
"b64_json": "iVBORw0KGgoAAAANSUhEUgAA..."
}
]
}URLs returned in response_format: "url" mode are temporary. If you need to keep the image, download it promptly or request b64_json and persist the bytes yourself.