Flux 2 Max API, Flux 2 Pro API, Flux Kontext API, Flux Pro VTO API, Flux 1.0 (Free) API: Pricing, Documentation

by Black Forest Labs

Flux 2 Max API, developers can access all Flux versions for generating highly detailed, photorealistic images from text prompts. The API supports advanced features like image-to-image transformation, style control, and batch processing for production workflows.

Get API Key
Flux API

Models Version

WELCOME BONUS

Get $5 Free Credit on First Payment

No strings attached — add funds and get $5 bonus instantly

Claim Your $5 →

FLUX 2 Max API Documentation

https://gateway.pixazo.ai/flux-2-max/v1

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

FLUX 2 Max generate request

Request Code

POST https://gateway.pixazo.ai/flux-2-max/v1/flux-2-max-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_API_KEY

{
  "prompt": "An intricate fantasy castle on a floating island at dusk, volumetric lighting, photoreal",
  "image_size": "landscape_4_3",
  "safety_tolerance": "2",
  "enable_safety_checker": true,
  "output_format": "jpeg",
  "sync_mode": false
}
import requests

url = "https://gateway.pixazo.ai/flux-2-max/v1/flux-2-max-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
    "prompt": "An intricate fantasy castle on a floating island at dusk, volumetric lighting, photoreal",
    "image_size": "landscape_4_3",
    "safety_tolerance": "2",
    "enable_safety_checker": true,
    "output_format": "jpeg",
    "sync_mode": false
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = "https://gateway.pixazo.ai/flux-2-max/v1/flux-2-max-request";
const headers = {
  "Content-Type": "application/json",
  "Cache-Control": "no-cache",
  "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
};
const data = {
  "prompt": "An intricate fantasy castle on a floating island at dusk, volumetric lighting, photoreal",
  "image_size": "landscape_4_3",
  "safety_tolerance": "2",
  "enable_safety_checker": true,
  "output_format": "jpeg",
  "sync_mode": false
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data));
curl -X POST "https://gateway.pixazo.ai/flux-2-max/v1/flux-2-max-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
        "prompt": "An intricate fantasy castle on a floating island at dusk, volumetric lighting, photoreal",
        "image_size": "landscape_4_3",
        "safety_tolerance": "2",
        "enable_safety_checker": true,
        "output_format": "jpeg",
        "sync_mode": false
    }'

Output

{
  "request_id": "flux-2-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your generate request to receive a POST callback instead of polling.

X-Webhook-URL: https://your-server.com/webhook/callback

Request Parameters - FLUX 2 Max generate request

Parameter Required Type Default Allowed values / range Description
promptYesstringText description for image generation. Must be detailed for optimal results.
image_sizeNostring or objectlandscape_4_3square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9; or {"width": integer, "height": integer}Preset aspect ratio or custom dimensions. Allowed presets: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9. Custom object format: {"width": integer, "height": integer}.
output_formatNostringjpegjpeg, pngOutput image format. Allowed: jpeg, png.
safety_toleranceNostring21, 2, 3, 4, 5NSFW filtering sensitivity level. Higher values are more permissive.
enable_safety_checkerNobooleantrueTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
seedNointegerRandom seed that controls the generation's randomness. Reuse the same seed with identical settings to reproduce the same result; leave it empty for a different output each time.
sync_modeNobooleanfalseIf on, the finished file is sent back directly instead of as a download link. Handy for quick tests; for normal use, leave it off to get a download link.

Example Request

{
  "prompt": "An intricate fantasy castle on a floating island at dusk, volumetric lighting, photoreal",
  "image_size": "landscape_4_3",
  "safety_tolerance": "2",
  "enable_safety_checker": true,
  "output_format": "jpeg",
  "sync_mode": false
}

Response

{
  "request_id": "flux-2-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_API_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-2-max' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-2-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-2-max",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-2-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-2-max_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-2-max",
  "error": null,
  "output": {
    "media_url": ["https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-2-max_019dxxxx/output.jpg"],
    "media_type": "image/jpeg"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstringWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

FLUX 2 Max API Pricing

UsagePrice (USD)
First megapixel$0.07
Each additional megapixel$0.03
Image to Image (Image Editing)

FLUX 2 Max API Documentation

https://gateway.pixazo.ai/flux-2-max-edit/v1

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

FLUX 2 Max Edit generate request

Request Code

POST https://gateway.pixazo.ai/flux-2-max-edit/v1/flux-2-max-edit-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_API_KEY

{
  "prompt": "Restyle the scene with warm golden-hour lighting and soft bokeh",
  "image_urls": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg"
  ],
  "image_size": "auto",
  "safety_tolerance": "2",
  "enable_safety_checker": true,
  "output_format": "jpeg",
  "sync_mode": false
}
import requests

url = "https://gateway.pixazo.ai/flux-2-max-edit/v1/flux-2-max-edit-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
    "prompt": "Restyle the scene with warm golden-hour lighting and soft bokeh",
    "image_urls": [
        "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg"
    ],
    "image_size": "auto",
    "safety_tolerance": "2",
    "enable_safety_checker": true,
    "output_format": "jpeg",
    "sync_mode": false
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const url = "https://gateway.pixazo.ai/flux-2-max-edit/v1/flux-2-max-edit-request";
const headers = {
  "Content-Type": "application/json",
  "Cache-Control": "no-cache",
  "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
};
const data = {
  "prompt": "Restyle the scene with warm golden-hour lighting and soft bokeh",
  "image_urls": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg"
  ],
  "image_size": "auto",
  "safety_tolerance": "2",
  "enable_safety_checker": true,
  "output_format": "jpeg",
  "sync_mode": false
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data));
curl -X POST "https://gateway.pixazo.ai/flux-2-max-edit/v1/flux-2-max-edit-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
    "prompt": "Restyle the scene with warm golden-hour lighting and soft bokeh",
    "image_urls": [
        "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Image.jpeg"
    ],
    "image_size": "auto",
    "safety_tolerance": "2",
    "enable_safety_checker": true,
    "output_format": "jpeg",
    "sync_mode": false
}'

Output

{
  "request_id": "flux-2-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your generate request to receive a POST callback instead of polling.

X-Webhook-URL: https://your-server.com/webhook/callback

Request Parameters - FLUX 2 Max Edit generate request

Parameter Required Type Default Allowed values / range Description
promptYesstringText instruction describing the desired edit. Must be detailed and specific for best results.
image_urlsYesstring[]Array of publicly accessible URLs of input images to edit. All images will be edited according to the same prompt.
image_sizeNostring or object"auto""auto", "square_hd", "square", "portrait_4_3", "portrait_16_9", "landscape_4_3", "landscape_16_9", or { "width": integer, "height": integer }Preset aspect ratio or custom dimensions. Allowed presets: `auto`, `square_hd`, `square`, `portrait_4_3`, `portrait_16_9`, `landscape_4_3`, `landscape_16_9`. Custom object format: `{ "width": integer, "height": integer }`.
output_formatNostring"jpeg""jpeg", "png"Output image format. Allowed: `jpeg`, `png`.
safety_toleranceNostring"2""1", "2", "3", "4", "5"Sensitivity level for NSFW filtering. Higher values are more permissive. Allowed: `1`, `2`, `3`, `4`, `5`.
enable_safety_checkerNobooleantrueEnable or disable the NSFW content filter. Set to `false` to bypass filtering.
seedNointegerOptional random seed for reproducible results. Use the same seed with identical inputs to get identical outputs.
sync_modeNobooleanfalseIf `true`, returns the edited image(s) as base64-encoded data URIs inline in the response. If `false`, returns a `request_id` for async polling.

Content Item Types & Limits

TypeMaxFormat / SizeDescription
imageJPG, PNG, WEBPImage(s) to edit.

Example Request

{
  "prompt": "Restyle the scene with warm golden-hour lighting and soft bokeh",
  "image_urls": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/recraft/a-breathtaking-mountain-landscape-at-golden-hour-w-1782135397335-0.webp"
  ],
  "image_size": "auto",
  "safety_tolerance": "2",
  "enable_safety_checker": true,
  "output_format": "jpeg",
  "sync_mode": false
}

Response

{
  "request_id": "flux-2-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_API_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-2-max-edit' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-2-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-2-max-edit",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-2-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-2-max-edit_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-2-max-edit",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-2-max-edit_019dxxxx/output.jpeg"
    ],
    "media_type": "image/jpeg"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstringWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

FLUX 2 Max API Pricing

ResolutionPrice (USD)
First megapixel$0.07
Each additional megapixel$0.03
2. Flux Pro VTO

Flux Pro VTO API Documentation

https://gateway.pixazo.ai/flux-pro-v1-virtual-try-on/v1/flux-pro-v1-virtual-try-on-request

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

FLUX Pro V1 Virtual Try-On generate request

Request Code

POST https://gateway.pixazo.ai/flux-pro-v1-virtual-try-on/v1/flux-pro-v1-virtual-try-on-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_API_KEY

{
  "prompt": "The garment is worn naturally, tucked in slightly at the waist",
  "human_image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Person.jpeg",
  "garment_image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Garment.jpeg",
  "num_inference_steps": 4,
  "output_format": "jpeg",
  "sync_mode": false
}
import requests

url = "https://gateway.pixazo.ai/flux-pro-v1-virtual-try-on/v1/flux-pro-v1-virtual-try-on-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
    "prompt": "The garment is worn naturally, tucked in slightly at the waist",
    "human_image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Person.jpeg",
    "garment_image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Garment.jpeg",
    "num_inference_steps": 4,
    "output_format": "jpeg",
    "sync_mode": false
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = "https://gateway.pixazo.ai/flux-pro-v1-virtual-try-on/v1/flux-pro-v1-virtual-try-on-request";
const headers = {
  "Content-Type": "application/json",
  "Cache-Control": "no-cache",
  "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
};
const data = {
  "prompt": "The garment is worn naturally, tucked in slightly at the waist",
  "human_image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Person.jpeg",
  "garment_image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Garment.jpeg",
  "num_inference_steps": 4,
  "output_format": "jpeg",
  "sync_mode": false
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data));
curl -X POST "https://gateway.pixazo.ai/flux-pro-v1-virtual-try-on/v1/flux-pro-v1-virtual-try-on-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --data-raw '{
    "prompt": "The garment is worn naturally, tucked in slightly at the waist",
    "human_image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Person.jpeg",
    "garment_image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/Garment.jpeg",
    "num_inference_steps": 4,
    "output_format": "jpeg",
    "sync_mode": false
}'

Output

{
  "request_id": "flux-pro-v1-virtual-try-on_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-pro-v1-virtual-try-on_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your generate request to receive a POST callback instead of polling.

X-Webhook-URL: https://your-server.com/webhook/callback

Request Parameters - FLUX Pro V1 Virtual Try-On generate request

Parameter Required Type Default Allowed values / range Description
promptYesstringNatural-language styling instructions describing how the garment should be worn (e.g., "tucked in slightly at the waist", "loose drape", "form-fitting").
human_image_urlYesstringURL of the front-facing person image. Maximum 2 megapixels; recommended under 1 megapixel. Must be publicly accessible.
garment_image_urlYesstringURL of the garment reference image. Maximum 1 megapixel; recommended around 0.5 megapixel. Must be publicly accessible.
num_inference_stepsNointeger41, 2, 3, 4Number of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster.
output_formatNostring"jpeg""jpeg", "png"Output image format.
seedNointegerRandom seed that controls the generation's randomness. Reuse the same seed with identical settings to reproduce the same result; leave it empty for a different output each time.
sync_modeNobooleanfalsetrue, falseIf on, the finished file is sent back directly instead of as a download link. Handy for quick tests; for normal use, leave it off to get a download link.

Content Item Types & Limits

TypeMaxFormat / SizeDescription
human_image_url1JPG, PNG, WEBPPerson photo (≤ 2 MP).
garment_image_url1JPG, PNG, WEBPGarment image (≤ 1 MP).

Example Request

{
  "prompt": "The garment is worn naturally, tucked in slightly at the waist",
  "human_image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/upscaler_019ed0c8-bb34-7854-afbc-b2a164758a15b/output.png",
  "garment_image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/nano-banana_019f1842-c359-7535-a90c-a798a408fbfa3/output.jpg",
  "num_inference_steps": 4,
  "output_format": "jpeg",
  "sync_mode": false
}

Response

{
  "request_id": "flux-pro-v1-virtual-try-on_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-pro-v1-virtual-try-on_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_API_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-pro-v1-virtual-try-on' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-pro-v1-virtual-try-on_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-pro-v1-virtual-try-on",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-pro-v1-virtual-try-on_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-pro-v1-virtual-try-on_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-pro-v1-virtual-try-on",
  "error": null,
  "output": { "media_url": ["https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-pro-v1-virtual-try-on_019dxxxx/output.jpeg"], "media_type": "image/jpeg" },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstringWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux Pro VTO API Pricing

Your request will cost $0.0475 per generation.
3. Flux 2 Pro

Flux 2 Pro API Documentation

https://gateway.pixazo.ai/flux-2-pro-image-to-image-866/v1/flux-2-pro-image-to-image-request

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Generate Request - flux 2 pro Image to Image API

Request Code

POST https://gateway.pixazo.ai/flux-2-pro-image-to-image-866/v1/flux-2-pro-image-to-image-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "Place realistic flames emerging from the top of the coffee cup, dancing above the rim",
  "image_size": "auto",
  "safety_tolerance": "2",
  "enable_safety_checker": false,
  "output_format": "jpeg",
  "image_urls": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana/nano-banana-a382a80b-f8df-4de1-a0c1-a5dcfd42dae4-1758783383399.jpg"
  ]
}
import requests

url = "https://gateway.pixazo.ai/flux-2-pro-image-to-image-866/v1/flux-2-pro-image-to-image-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "Place realistic flames emerging from the top of the coffee cup, dancing above the rim",
    "image_size": "auto",
    "safety_tolerance": "2",
    "enable_safety_checker": false,
    "output_format": "jpeg",
    "image_urls": [
        "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana/nano-banana-a382a80b-f8df-4de1-a0c1-a5dcfd42dae4-1758783383399.jpg"
    ]
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-2-pro-image-to-image-866/v1/flux-2-pro-image-to-image-request';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
  prompt: 'Place realistic flames emerging from the top of the coffee cup, dancing above the rim',
  image_size: 'auto',
  safety_tolerance: '2',
  enable_safety_checker: false,
  output_format: 'jpeg',
  image_urls: [
    'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana/nano-banana-a382a80b-f8df-4de1-a0c1-a5dcfd42dae4-1758783383399.jpg'
  ]
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/flux-2-pro-image-to-image-866/v1/flux-2-pro-image-to-image-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "prompt": "Place realistic flames emerging from the top of the coffee cup, dancing above the rim",
    "image_size": "auto",
    "safety_tolerance": "2",
    "enable_safety_checker": false,
    "output_format": "jpeg",
    "image_urls": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana/nano-banana-a382a80b-f8df-4de1-a0c1-a5dcfd42dae4-1758783383399.jpg"
    ]
  }'

Output

{
  "request_id": "flux-2-pro-image-to-image-866_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-image-to-image-866_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "flux-2-pro-image-to-image-866_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-2-pro-image-to-image-866",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-2-pro-image-to-image-866_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "flux-2-pro-image-to-image-866_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-2-pro-image-to-image-866",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Generate Request

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringA descriptive text prompt guiding the image transformation (e.g., style, lighting, elements to add or remove)
image_urlsYesarray[string]One or more publicly accessible image URLs to be edited. Only the first image will be processed if multiple are provided.
image_sizeNostringDimensions of the output image. Use "auto" to preserve input dimensions, or specify "512x512", "1024x1024", etc.
safety_toleranceNostringControls sensitivity of content moderation. Higher values allow more permissive outputs. Accepts "1" (strict), "2" (moderate), "3" (relaxed).
enable_safety_checkerNobooleantrue, falseTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
output_formatNostring"jpeg", "png", "webp"Format of the generated image output. Supported values: "jpeg", "png", "webp"

Content Item Types & Limits

TypeMaxFormat / SizeDescription
imageJPG, PNG, WEBPImage(s) to transform.

Example Request

{
  "prompt": "Place realistic sparks and glowing embers erupting between the two fighting robots, emphasizing the impact of their clash.",
  "image_size": "auto",
  "safety_tolerance": "2",
  "enable_safety_checker": false,
  "output_format": "jpeg",
  "image_urls": [
    "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/nano-banana/nano-banana-a382a80b-f8df-4de1-a0c1-a5dcfd42dae4-1758783383399.jpg"
  ]
}

Response

{
  "request_id": "flux-2-pro-image-to-image-866_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-image-to-image-866_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-2-pro-image-to-image-866' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-2-pro-image-to-image-866_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-2-pro-image-to-image-866",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-image-to-image-866_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-2-pro-image-to-image-866_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-2-pro-image-to-image-866",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-2-pro-image-to-image-866_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux 2 Pro API Pricing

Your request will cost $0.06 per image.
Image to Image (LoRA Trainer)

Flux 2 Pro API Documentation

https://gateway.pixazo.ai/flux-2-pro-image-to-image-trainer-831/v1/flux-2-pro-image-to-image-trainer-request

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Generate Request - flux 2 pro Image to Image Trainer API

Request Code

POST https://gateway.pixazo.ai/flux-2-pro-image-to-image-trainer-831/v1/flux-2-pro-image-to-image-trainer-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "image_data_url": "https://example.com/images/reference_style.jpg",
  "steps": 1200,
  "learning_rate": 0.00007
}
import requests

url = "https://gateway.pixazo.ai/flux-2-pro-image-to-image-trainer-831/v1/flux-2-pro-image-to-image-trainer-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "image_data_url": "https://example.com/images/reference_style.jpg",
    "steps": 1200,
    "learning_rate": 0.00007
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const url = "https://gateway.pixazo.ai/flux-2-pro-image-to-image-trainer-831/v1/flux-2-pro-image-to-image-trainer-request";

const headers = {
  "Content-Type": "application/json",
  "Cache-Control": "no-cache",
  "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
};

const data = {
  image_data_url: "https://example.com/images/reference_style.jpg",
  steps: 1200,
  learning_rate: 0.00007
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
curl -X POST "https://gateway.pixazo.ai/flux-2-pro-image-to-image-trainer-831/v1/flux-2-pro-image-to-image-trainer-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "image_data_url": "https://example.com/images/reference_style.jpg",
    "steps": 1200,
    "learning_rate": 0.00007
  }'

Output

{
  "request_id": "flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-2-pro-image-to-image-trainer-831",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-2-pro-image-to-image-trainer-831",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Generate Request

ParameterRequiredTypeDefaultAllowed values / rangeDescription
image_data_urlYesstringBase64-encoded URL or public HTTP/S URL pointing to a reference image used for training. Must be a high-resolution, high-quality image representative of the desired style or domain.
stepsNointegerNumber of training steps to perform. Higher values yield more refined models but require longer processing time.
learning_rateNonumberHow fast the model learns during training. Lower values train more slowly but more reliably; higher values train faster but risk unstable results.

Example Request

{
  "image_data_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/upscaler_019ed0c8-bb34-7854-afbc-b2a164758a15b/output.png",
  "steps": 1200,
  "learning_rate": 0.00007
}

Response

{
  "request_id": "flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-2-pro-image-to-image-trainer-831' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-2-pro-image-to-image-trainer-831",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-2-pro-image-to-image-trainer-831",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-2-pro-image-to-image-trainer-831_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux 2 Pro API Pricing

Your request will cost $8.00 per LoRA training job.
Text to Image

Flux 2 Pro API Documentation

https://gateway.pixazo.ai/flux-2-pro-text-to-image-799/v1/flux-2-pro-text-to-image-request

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Generate Request - flux 2 pro Text to Image API

Request Code

POST https://gateway.pixazo.ai/flux-2-pro-text-to-image-799/v1/flux-2-pro-text-to-image-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "An intense close-up of knight's visor reflecting battle, sword raised, flames in background, chiaroscuro helmet shadows, hyper-detailed armor, square medieval, cinematic lighting",
  "image_size": "landscape_4_3",
  "safety_tolerance": 2,
  "enable_safety_checker": true,
  "output_format": "jpeg"
}
import requests

url = "https://gateway.pixazo.ai/flux-2-pro-text-to-image-799/v1/flux-2-pro-text-to-image-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "An intense close-up of knight's visor reflecting battle, sword raised, flames in background, chiaroscuro helmet shadows, hyper-detailed armor, square medieval, cinematic lighting",
    "image_size": "landscape_4_3",
    "safety_tolerance": 2,
    "enable_safety_checker": True,
    "output_format": "jpeg"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-2-pro-text-to-image-799/v1/flux-2-pro-text-to-image-request';

const data = {
  prompt: "An intense close-up of knight's visor reflecting battle, sword raised, flames in background, chiaroscuro helmet shadows, hyper-detailed armor, square medieval, cinematic lighting",
  image_size: "landscape_4_3",
  safety_tolerance: 2,
  enable_safety_checker: true,
  output_format: "jpeg"
};

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/flux-2-pro-text-to-image-799/v1/flux-2-pro-text-to-image-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "prompt": "An intense close-up of knight\'s visor reflecting battle, sword raised, flames in background, chiaroscuro helmet shadows, hyper-detailed armor, square medieval, cinematic lighting",
    "image_size": "landscape_4_3",
    "safety_tolerance": 2,
    "enable_safety_checker": true,
    "output_format": "jpeg"
  }'

Output

{
  "request_id": "flux-2-pro-text-to-image-799_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-text-to-image-799_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "flux-2-pro-text-to-image-799_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-2-pro-text-to-image-799",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-2-pro-text-to-image-799_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "flux-2-pro-text-to-image-799_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-2-pro-text-to-image-799",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Generate Request

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringA detailed text description of the desired image. Be specific about subject, style, lighting, composition, and mood.
image_sizeNostringportrait_4_5, portrait_9_16, square_1_1, landscape_3_2, landscape_4_3, landscape_16_9, landscape_21_9The aspect ratio and dimensions of the generated image. Supported values: portrait_4_5, portrait_9_16, square_1_1, landscape_3_2, landscape_4_3, landscape_16_9, landscape_21_9.
safety_toleranceNointegerControls sensitivity of the safety filter. Lower values (1-2) are more restrictive; higher values (3-4) allow more expressive content.
enable_safety_checkerNobooleantrue, falseTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
output_formatNostringjpeg, png, webpThe file format of the generated image. Supported values: jpeg, png, webp.

Example Request

{
  "prompt": "An intense close-up of knight's visor reflecting battle, sword raised, flames in background, chiaroscuro helmet shadows, hyper-detailed armor, square medieval, cinematic lighting",
  "image_size": "landscape_4_3",
  "safety_tolerance": 2,
  "enable_safety_checker": true,
  "output_format": "jpeg"
}

Response

{
  "request_id": "flux-2-pro-text-to-image-799_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-text-to-image-799_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-2-pro-text-to-image-799' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-2-pro-text-to-image-799_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-2-pro-text-to-image-799",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-text-to-image-799_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-2-pro-text-to-image-799_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-2-pro-text-to-image-799",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-2-pro-text-to-image-799_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux 2 Pro API Pricing

Your request will cost $0.06 per image.
Image to Image (LoRA Trainer)

Flux 2 Pro API Documentation

https://gateway.pixazo.ai/flux-2-pro-text-to-image-trainer-712/v1/flux-2-pro-text-to-image-trainer-request

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Generate Request - flux 2 pro Text to Image Trainer API

Request Code

POST https://gateway.pixazo.ai/flux-2-pro-text-to-image-trainer-712/v1/flux-2-pro-text-to-image-trainer-request
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "image_data_url": "https://example.com/dataset.zip",
  "steps": 1500,
  "learning_rate": 0.00003
}
import requests

url = "https://gateway.pixazo.ai/flux-2-pro-text-to-image-trainer-712/v1/flux-2-pro-text-to-image-trainer-request"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "image_data_url": "https://example.com/dataset.zip",
    "steps": 1500,
    "learning_rate": 0.00003
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-2-pro-text-to-image-trainer-712/v1/flux-2-pro-text-to-image-trainer-request';

const data = {
  image_data_url: 'https://example.com/dataset.zip',
  steps: 1500,
  learning_rate: 0.00003
};

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/flux-2-pro-text-to-image-trainer-712/v1/flux-2-pro-text-to-image-trainer-request" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "image_data_url": "https://example.com/dataset.zip",
    "steps": 1500,
    "learning_rate": 0.00003
  }'

Output

{
  "request_id": "flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-2-pro-text-to-image-trainer-712",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-2-pro-text-to-image-trainer-712",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Generate Request

ParameterRequiredTypeDefaultAllowed values / rangeDescription
image_data_urlYesstringBase64-encoded URL or HTTP(S) endpoint pointing to a dataset of training images (PNG/JPG). Must include multiple samples (minimum 10 recommended) to train a robust LoRA model.
stepsNointegerNumber of training steps to perform. Higher values improve model quality but increase training time.
learning_rateNonumberHow fast the model learns during training. Lower values train more slowly but more reliably; higher values train faster but risk unstable results.

Example Request

{
  "image_data_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/upscaler_019ed0c8-bb34-7854-afbc-b2a164758a15b/output.png",
  "steps": 1500,
  "learning_rate": 0.00003
}

Response

{
  "request_id": "flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-2-pro-text-to-image-trainer-712' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-2-pro-text-to-image-trainer-712",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-2-pro-text-to-image-trainer-712",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-2-pro-text-to-image-trainer-712_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux 2 Pro API Pricing

Your request will cost $8.00 per LoRA training job.
4. Flux Kontext

Flux Kontext API Documentation

https://gateway.pixazo.ai/flux-kontext-restore-image/v1/flux-kontext-restore-image/generate

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Image Restore Request - Flux Kontext Restore Image

Request Code

POST https://gateway.pixazo.ai/flux-kontext-restore-image/v1/flux-kontext-restore-image/generate HTTP/1.1
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "input_image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png"
}
import requests

url = "https://gateway.pixazo.ai/flux-kontext-restore-image/v1/flux-kontext-restore-image/generate"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "input_image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-kontext-restore-image/v1/flux-kontext-restore-image/generate';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
  input_image: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png'
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/flux-kontext-restore-image/v1/flux-kontext-restore-image/generate" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "input_image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.png"
  }'

Output

{
  "request_id": "flux-kontext-restore-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-kontext-restore-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "flux-kontext-restore-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-kontext-restore-image",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-kontext-restore-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "flux-kontext-restore-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-kontext-restore-image",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Flux Kontext Restore Image

ParameterRequiredTypeDefaultAllowed values / rangeDescription
input_imageYesstring (URL)The image to restore. Supported formats: jpeg, png, gif, webp.
seedNointegerrandomRandom seed that controls the generation's randomness. Reuse the same seed with identical settings to reproduce the same result; leave it empty for a different output each time.
output_formatNostring"png"jpg , pngOutput image format. Allowed values: jpg, png.
safety_toleranceNointeger20 – 2Content safety threshold. Allowed values: 02. 0 is the strictest, 2 the most permissive (max allowed).

Content Item Types & Limits

TypeMaxFormat / SizeDescription
image1JPG, PNG, GIF, WEBP · < 20 MBImage to restore.

Example Request

{
  "input_image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/gpt-image-1-5-api-923_019ecf03-5887-7781-659f-bc0d541e2b98a/output.png",
  "seed": 42,
  "output_format": "png",
  "safety_tolerance": 2,
  "webhook": "https://your-server.com/webhooks/flux-kontext-restore-image",
  "webhook_events_filter": ["completed", "failed"]
}

Response

{
  "request_id": "flux-kontext-restore-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-kontext-restore-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-kontext-restore-image' not found or is disabled"
}

Model Validation Errors (400)

// Examples
{ "error": "input_image is required and must be a string URL" }
{ "error": "input_image must be a valid URL" }
{ "error": "output_format must be one of: jpg, png" }
{ "error": "safety_tolerance must be an integer in [0, 2]" }
{ "error": "seed must be a non-negative integer" }
{ "error": "Invalid webhook URL" }

Error via Status/Webhook

{
  "request_id": "flux-kontext-restore-image_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-kontext-restore-image",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-kontext-restore-image_019d42ce-ae71-7999-24c9-5d76447ecafb4"

Response (Completed)

{
  "request_id": "flux-kontext-restore-image_019d42ce-ae71-7999-24c9-5d76447ecafb4",
  "status": "COMPLETED",
  "model_id": "flux-kontext-restore-image",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-kontext-restore-image_019d42ce-ae71-7999-24c9-5d76447ecafb4/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-01T14:30:28.735Z",
  "updated_at": "2026-05-01T14:31:18.000Z",
  "completed_at": "2026-05-01T14:31:18.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type (image/png or image/jpeg)
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux Kontext API Pricing

Your request will cost $0.04 per image.
5. Flux 2 Klein

Flux 2 Klein API Documentation

https://gateway.pixazo.ai/flux-2-klein-4b/v1/generateImage

Text to Image - Flux 2 klein 4b

Request Code

POST https://gateway.pixazo.ai/flux-2-klein-4b/v1/generateImage
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "A sunset with a dog playing on the beach, golden light reflecting on the water, photorealistic, highly detailed",
  "steps": 25,
  "width": 1024,
  "height": 1024
}
import requests

url = "https://gateway.pixazo.ai/flux-2-klein-4b/v1/generateImage"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "A sunset with a dog playing on the beach, golden light reflecting on the water, photorealistic, highly detailed",
    "steps": 25,
    "width": 1024,
    "height": 1024
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-2-klein-4b/v1/generateImage';

const data = {
  prompt: 'A sunset with a dog playing on the beach, golden light reflecting on the water, photorealistic, highly detailed',
  steps: 25,
  width: 1024,
  height: 1024
};

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/flux-2-klein-4b/v1/generateImage" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
    "prompt": "A sunset with a dog playing on the beach, golden light reflecting on the water, photorealistic, highly detailed",
    "steps": 25,
    "width": 1024,
    "height": 1024
}'

Output

{
  "output": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/flux-2-klein-4b/1768578707564-851083.png"
}

Request Parameters - Text to Image

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringThe text query that instructs the AI model on what kind of content to generate.
stepsNointeger25The number of diffusion steps; higher values can improve quality but take longer. Default: 25
widthNointeger1024The desired width of the generated image, specified in pixels. Default: 1024. Supported sizes: 512, 1024, 1448, 2048
heightNointeger1024The desired height of the generated image, specified in pixels. Default: 1024. Supported sizes: 512, 1024, 1448, 2048

Example Request

{
  "prompt": "A sunset with a dog playing on the beach, golden light reflecting on the water, photorealistic, highly detailed",
  "steps": 25,
  "width": 1024,
  "height": 1024
}

Response

{
  "output": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/flux-2-klein-4b/1768578707564-851083.png"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes for Text to Image.

Code Meaning
200 Success
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal Server Error

Flux 2 Klein API Pricing

ResolutionPrice (USD)
512x512$0.0003
1024×1024$0.0007
1448×1448$0.0014
2048×2048$0.0028
6. Flux 2 Dev

Flux 2 Dev API Documentation

https://gateway.pixazo.ai/flux-2-dev/v1/generateT2I

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

generateT2I - Flux 2 dev API

Request Code

POST https://gateway.pixazo.ai/flux-2-dev/v1/generateT2I
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_API_KEY

{
  "prompt": "a sunset at the alps"
}
import requests

url = "https://gateway.pixazo.ai/flux-2-dev/v1/generateT2I"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_API_KEY"
}
data = {
    "prompt": "a sunset at the alps"
}

# Generation takes ~60-90 seconds; set an appropriate timeout.
response = requests.post(url, json=data, headers=headers, timeout=180)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-2-dev/v1/generateT2I';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_API_KEY'
};
const data = {
  prompt: 'a sunset at the alps'
};

// Generation takes ~60-90 seconds; the request stays open until the image is ready.
fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -X POST "https://gateway.pixazo.ai/flux-2-dev/v1/generateT2I" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  --max-time 180 \
  --data-raw '{
    "prompt": "a sunset at the alps"
  }'

Output

{
  "output": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/flux-2-dev-cf/1762439647765-844809.png"
}

Synchronous Response

This endpoint is synchronous. The HTTP request remains open until image generation and R2 upload complete, then returns the final image URL in a single response. There is no polling step and no request_id to track. Typical end-to-end time is 60-90 seconds; configure your HTTP client timeout to at least 180 seconds.

Request Parameters - generateT2I

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringText description of the image to generate

Example Request

{
  "prompt": "a sunset at the alps"
}

Response

{
  "output": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/flux-2-dev-cf/1762439647765-844809.png"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_API_KEY

Response Handling

Common status codes.

CodeMeaning
200Success — response body contains the generated image URL
Bad Request — invalid or missing prompt
401Unauthorized — invalid subscription key
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Response Fields

FieldTypeDescription
outputstringPublic URL of the generated PNG image, hosted on Pixazo's R2 CDN

Flux 2 Dev API Pricing

Your request will cost $0.012 per image.
7. Flux Pro 1.1

Flux Pro 1.1 API Documentation

https://gateway.pixazo.ai/pro1.1/v1/pro1.1ultra/generateRequest

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Pro1.1 Ultra generateRequest - Flux pro 1.1

Request Code

POST https://gateway.pixazo.ai/pro1.1/v1/pro1.1ultra/generateRequest
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "A futuristic cityscape at sunset",
  "seed": 43,
  "output_format": "jpeg",
  "aspect_ratio": "16:9"
}
import requests

url = "https://gateway.pixazo.ai/pro1.1/v1/pro1.1ultra/generateRequest"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "A futuristic cityscape at sunset",
    "seed": 43,
    "output_format": "jpeg",
    "aspect_ratio": "16:9"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/pro1.1/v1/pro1.1ultra/generateRequest';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
  prompt: 'A futuristic cityscape at sunset',
  seed: 43,
  output_format: 'jpeg',
  aspect_ratio: '16:9'
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/pro1.1/v1/pro1.1ultra/generateRequest" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
  "prompt": "A futuristic cityscape at sunset",
  "seed": 43,
  "output_format": "jpeg",
  "aspect_ratio": "16:9"
}'

Output

{
  "request_id": "flux-pro-1-1_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-pro-1-1_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "flux-pro-1-1_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-pro-1-1",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-pro-1-1_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "flux-pro-1-1_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-pro-1-1",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Pro1.1 Ultra generateRequest

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringThe instruction or description for the image to be generated. FLUX1.1 [pro] ultra delivers professional-grade image quality with enhanced photo realism and up to 2K resolution
seedOptionalintegerRandom seed that controls the generation's randomness. Reuse the same seed with identical settings to reproduce the same result; leave it empty for a different output each time.
sync_modeOptionalbooleantrue, falseIf on, the finished file is sent back directly instead of as a download link. Handy for quick tests; for normal use, leave it off to get a download link.
num_imagesOptionalintegerThe number of images to generate
enable_safety_checkerOptionalbooleantrue, falseTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
output_formatOptionalstringThe format of the generated image. Values: "jpeg", "png"
safety_toleranceOptionalstringThe safety tolerance level for generated images. 1 is most strict, 6 is most permissive. Values: "1", "2", "3", "4", "5", "6"
enhance_promptOptionalbooleantrue, falseAutomatically rewrites and enriches your prompt with extra detail before generation to improve results.
aspect_ratioOptionalstringThe aspect ratio of the generated image. Values: "21:9", "16:9", "4:3", "3:2", "1:1", "2:3", "3:4", "9:16", "9:21"
rawOptionalbooleantrue, falseGenerate less processed, more natural-looking images

Example Request

{
  "prompt": "A futuristic cityscape at sunset",
  "seed": 43,
  "output_format": "jpeg",
  "aspect_ratio": "16:9"
}

Response

{
  "request_id": "flux-pro-1-1_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-pro-1-1_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-pro-1-1' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-pro-1-1_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-pro-1-1",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-pro-1-1_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-pro-1-1_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-pro-1-1",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-pro-1-1_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux Pro 1.1 API Pricing

Your request will cost $0.08 per image.
8. Flux 1 Schnell

Flux 1 Schnell API Documentation

https://gateway.pixazo.ai/flux-1-schnell/v1/getData

Get Image - flux-1 Schnell API

Request Code

POST https://gateway.pixazo.ai/flux-1-schnell/v1/getData
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "Picture a sleek, futuristic car racing through a neon-lit cityscape, its engine humming efficiently as it blurs past digital billboards. The driver skillfully navigates the glowing streets, aiming for victory in this high-tech, adrenaline-fueled race of tomorrow.",
  "num_steps": 4,
  "seed": 15,
  "height": 512,
  "width": 512
}
import requests

url = "https://gateway.pixazo.ai/flux-1-schnell/v1/getData"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "Picture a sleek, futuristic car racing through a neon-lit cityscape, its engine humming efficiently as it blurs past digital billboards. The driver skillfully navigates the glowing streets, aiming for victory in this high-tech, adrenaline-fueled race of tomorrow.",
    "num_steps": 4,
    "seed": 15,
    "height": 512,
    "width": 512
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-1-schnell/v1/getData';

const data = {
  prompt: "Picture a sleek, futuristic car racing through a neon-lit cityscape, its engine humming efficiently as it blurs past digital billboards. The driver skillfully navigates the glowing streets, aiming for victory in this high-tech, adrenaline-fueled race of tomorrow.",
  num_steps: 4,
  seed: 15,
  height: 512,
  width: 512
};

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/flux-1-schnell/v1/getData" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
    "prompt": "Picture a sleek, futuristic car racing through a neon-lit cityscape, its engine humming efficiently as it blurs past digital billboards. The driver skillfully navigates the glowing streets, aiming for victory in this high-tech, adrenaline-fueled race of tomorrow.",
    "num_steps": 4,
    "seed": 15,
    "height": 512,
    "width": 512
}'

Output

{
  "output": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/flux-schnell-cf/prompt-1768311018384-879091.png"
}

Request Parameters - Get Image

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringThe text query that instructs the AI model on what kind of content to generate.
num_stepsNointeger4Number of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster.
seedNointegerRandom seed that controls the generation's randomness. Reuse the same seed with identical settings to reproduce the same result; leave it empty for a different output each time.
heightNointeger1024The desired height of the generated image, specified in pixels. Default: 1024
widthNointeger1024The desired width of the generated image, specified in pixels. Default: 1024

Example Request

{
  "prompt": "Picture a sleek, futuristic car racing through a neon-lit cityscape, its engine humming efficiently as it blurs past digital billboards. The driver skillfully navigates the glowing streets, aiming for victory in this high-tech, adrenaline-fueled race of tomorrow.",
  "num_steps": 4,
  "seed": 15,
  "height": 512,
  "width": 512
}

Response

{
  "output": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/flux-schnell-cf/prompt-1768311018384-879091.png"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes for Get Image.

Code Meaning
200 Success
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal Server Error

Flux 1 Schnell API Pricing

Your request is Free
Free during preview — fair-use rate limit of 60 requests/minute applies. See terms.
Text to Image (Batch)

Flux 1 Schnell API Documentation

https://gateway.pixazo.ai/flux-1-schnell/v1/getDataBatch

Get Image Batch - flux-1 Schnell API

Request Code

POST https://gateway.pixazo.ai/flux-1-schnell/v1/getDataBatch
Content-Type: application/json
X-Secret-Key: YOUR_SECRET_KEY
Cache-Control: no-cache

{
  "prompt": "Picture a handsome man dancing",
  "num_steps": 4,
  "seed": 15,
  "height": 512,
  "width": 512,
  "webhook_url": "https://your-domain.com/webhook"
}
import requests

url = "https://gateway.pixazo.ai/flux-1-schnell/v1/getDataBatch"
headers = {
    "Content-Type": "application/json",
    "X-Secret-Key": "YOUR_SECRET_KEY",
    "Cache-Control": "no-cache"
}
data = {
    "prompt": "Picture a handsome man dancing",
    "num_steps": 4,
    "seed": 15,
    "height": 512,
    "width": 512,
    "webhook_url": "https://your-domain.com/webhook"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-1-schnell/v1/getDataBatch';
const headers = {
  'Content-Type': 'application/json',
  'X-Secret-Key': 'YOUR_SECRET_KEY',
  'Cache-Control': 'no-cache'
};

const data = {
  prompt: 'Picture a handsome man dancing',
  num_steps: 4,
  seed: 15,
  height: 512,
  width: 512,
  webhook_url: 'https://your-domain.com/webhook'
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/flux-1-schnell/v1/getDataBatch" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "X-Secret-Key: YOUR_SECRET_KEY" \
  --data-raw '{
    "prompt": "Picture a handsome man dancing",
    "num_steps": 4,
    "seed": 15,
    "height": 512,
    "width": 512,
    "webhook_url": "https://your-domain.com/webhook"
  }'

Output

{
  "requestId": "18a36237-f8b2-4c8d-9a3b-d5e8a9f12c45",
  "status": "queued",
  "message": "Request queued. Result will be sent to the provided webhook URL.",
  "pollingEndpoint": "/checkStatus",
  "pollingInstructions": "POST to /checkStatus with {...}"
}

Request Parameters - Get Image Batch

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringThe text prompt used to generate the image. Describes the style and content for the generated image. The prompt is automatically sanitized to avoid content moderation false positives.
num_stepsNointeger1–4Number of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster.
seedNointegerRandom seed that controls the generation's randomness. Reuse the same seed with identical settings to reproduce the same result; leave it empty for a different output each time.
widthNointegerWidth of the generated image in pixels. Recommended values: 512, 768, 1024, 1280, 1536, 1920.
heightNointegerHeight of the generated image in pixels. Recommended values: 512, 768, 1024, 1280, 1536, 1920.
webhook_urlNostringURL to receive the result via HTTP POST when processing completes. If provided, the API returns immediately with status 202. If omitted, the API attempts internal polling for up to 60 seconds.

Example Request

{
  "prompt": "Picture a handsome man dancing",
  "num_steps": 4,
  "seed": 15,
  "height": 512,
  "width": 512,
  "webhook_url": "https://your-domain.com/webhook"
}

Response

{
  "requestId": "18a36237-f8b2-4c8d-9a3b-d5e8a9f12c45",
  "status": "queued",
  "message": "Request queued. Result will be sent to the provided webhook URL.",
  "pollingEndpoint": "/checkStatus",
  "pollingInstructions": "POST to /checkStatus with {\"requestId\": \"18a36237-f8b2-4c8d-9a3b-d5e8a9f12c45\"}"
}

Request Headers

Header Value
Content-Typeapplication/json
X-Secret-KeyYOUR_SECRET_KEY
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes for Get Image Batch.

Code Meaning
200 Success
Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Too Many Requests
500 Internal Server Error

Checking Job Status

After submitting your request, use this endpoint to check status and retrieve results.

Endpoint

POST https://gateway.pixazo.ai/flux-1-schnell/v1/checkStatus

Request Body

{ "requestId": "18a36237-f8b2-4c8d-9a3b-d5e8a9f12c45" }

Code Examples

POST https://gateway.pixazo.ai/flux-1-schnell/v1/checkStatus
Content-Type: application/json
X-Secret-Key: YOUR_SECRET_KEY
Cache-Control: no-cache

{
  "requestId": "18a36237-f8b2-4c8d-9a3b-d5e8a9f12c45"
}
import requests

url = "https://gateway.pixazo.ai/flux-1-schnell/v1/checkStatus"
headers = {
    "Content-Type": "application/json",
    "X-Secret-Key": "YOUR_SECRET_KEY",
    "Cache-Control": "no-cache"
}
data = {
    "requestId": "18a36237-f8b2-4c8d-9a3b-d5e8a9f12c45"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-1-schnell/v1/checkStatus';
const headers = {
  'Content-Type': 'application/json',
  'X-Secret-Key': 'YOUR_SECRET_KEY',
  'Cache-Control': 'no-cache'
};

const data = {
  requestId: '18a36237-f8b2-4c8d-9a3b-d5e8a9f12c45'
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/flux-1-schnell/v1/checkStatus" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "X-Secret-Key: YOUR_SECRET_KEY" \
  --data-raw '{
    "requestId": "18a36237-f8b2-4c8d-9a3b-d5e8a9f12c45"
  }'

Response Examples

{ "status": "completed", "output": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/flux-schnell-cf/prompt-1768311018384-879091.png", "completedAt": 1768311019767 }

Flux 1 Schnell API Pricing

Your request is Free
Free during preview — fair-use rate limit of 60 requests/minute applies. See terms.
9. Flux Pro

Flux Pro API Documentation

https://gateway.pixazo.ai/flux-pro/v1/pro/textToImage

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Text To Image - Flux Pro API

Request Code

POST https://gateway.pixazo.ai/flux-pro/v1/pro/textToImage
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "A futuristic cityscape at sunset with flying cars",
  "image_size": "landscape_4_3"
}
import requests

url = "https://gateway.pixazo.ai/flux-pro/v1/pro/textToImage"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "A futuristic cityscape at sunset with flying cars",
    "image_size": "landscape_4_3"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-pro/v1/pro/textToImage';

const data = {
  prompt: 'A futuristic cityscape at sunset with flying cars',
  image_size: 'landscape_4_3'
};

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/flux-pro/v1/pro/textToImage" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
  "prompt": "A futuristic cityscape at sunset with flying cars",
  "image_size": "landscape_4_3"
}'

Output

{
  "request_id": "flux-pro_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-pro_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "flux-pro_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-pro",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-pro_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "flux-pro_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-pro",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Text To Image

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringThe instruction or description for the image to be generated
image_sizeOptionalstringThe aspect ratio of the generated image, Possible enum values: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9
num_inference_stepsOptionalintegerNumber of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster.
guidance_scaleOptionalfloatControls how closely the output follows your prompt (prompt adherence). Higher values stick more strictly to the prompt; lower values allow more creative variation.
num_imagesOptionalintegerThe number of images to generate
enable_safety_checkerOptionalbooleantrue, falseTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
output_formatOptionalstringThe format of the generated image. Values: "jpeg", "png"

Example Request

{
  "prompt": "A futuristic cityscape at sunset with flying cars",
  "image_size": "landscape_4_3"
}

Response

{
  "request_id": "flux-pro_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-pro_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-pro' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-pro_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-pro",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-pro_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-pro_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-pro",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-pro_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux Pro API Pricing

Your request will cost $0.03 per image.
10. Flux Dev

Flux Dev API Documentation

https://gateway.pixazo.ai/flux-dev/v1/dev/imageToImage

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Image To Image - flux Dev API

Request Code

POST https://gateway.pixazo.ai/flux-dev/v1/dev/imageToImage
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/model.png",
  "prompt": "Editorial rooftop shot, woman in peach tee and denim, modern urban backdrop, bold blue tones, polished aesthetic."
}
import requests

url = "https://gateway.pixazo.ai/flux-dev/v1/dev/imageToImage"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/model.png",
    "prompt": "Editorial rooftop shot, woman in peach tee and denim, modern urban backdrop, bold blue tones, polished aesthetic."
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-dev/v1/dev/imageToImage';

const data = {
  image_url: 'https://pub-582b7213209642b9b995c96c95a30381.r2.dev/model.png',
  prompt: 'Editorial rooftop shot, woman in peach tee and denim, modern urban backdrop, bold blue tones, polished aesthetic.'
};

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Cache-Control': 'no-cache',
    'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
  },
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/flux-dev/v1/dev/imageToImage" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" --data-raw '{
  "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/model.png",
  "prompt": "Editorial rooftop shot, woman in peach tee and denim, modern urban backdrop, bold blue tones, polished aesthetic."
}'

Output

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-dev",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-dev",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Image To Image

ParameterRequiredTypeDefaultAllowed values / rangeDescription
image_urlYesstringThe URL of the source image to transform
promptYesstringThe instruction or description for how to transform the image
strengthOptionalfloatHow much the result may differ from the input. Higher values allow bigger changes from the source; lower values keep the output closer to the original.
num_inference_stepsOptionalintegerNumber of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster.
guidance_scaleOptionalfloatControls how closely the output follows your prompt (prompt adherence). Higher values stick more strictly to the prompt; lower values allow more creative variation.
num_imagesOptionalintegerThe number of images to generate
enable_safety_checkerOptionalbooleantrue, falseTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
output_formatOptionalstringThe format of the generated image. Values: "jpeg", "png"
accelerationOptionalstringThe speed of generation. Values: "none", "regular", "high"

Content Item Types & Limits

TypeMaxFormat / SizeDescription
image1JPG, PNG, WEBPImage to transform.

Example Request

{
  "image_url": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/model.png",
  "prompt": "Editorial rooftop shot, woman in peach tee and denim, modern urban backdrop, bold blue tones, polished aesthetic."
}

Response

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-dev' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-dev",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-dev",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-dev_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux Dev API Pricing

Your request will cost $0.025 per image.
Text to Image

Flux Dev API Documentation

https://gateway.pixazo.ai/flux-dev/v1/dev/textToImage

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Text To Image - flux Dev API

Request Code

POST https://gateway.pixazo.ai/flux-dev/v1/dev/textToImage
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "A futuristic city skyline at sunset with flying cars",
  "image_size": "landscape_4_3"
}
import requests

url = "https://gateway.pixazo.ai/flux-dev/v1/dev/textToImage"
headers = {
    "Content-Type": "application/json",
    "Cache-Control": "no-cache",
    "Ocp-Apim-Subscription-Key": "YOUR_SUBSCRIPTION_KEY"
}
data = {
    "prompt": "A futuristic city skyline at sunset with flying cars",
    "image_size": "landscape_4_3"
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
const url = 'https://gateway.pixazo.ai/flux-dev/v1/dev/textToImage';
const headers = {
  'Content-Type': 'application/json',
  'Cache-Control': 'no-cache',
  'Ocp-Apim-Subscription-Key': 'YOUR_SUBSCRIPTION_KEY'
};
const data = {
  prompt: 'A futuristic city skyline at sunset with flying cars',
  image_size: 'landscape_4_3'
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
curl -v -X POST "https://gateway.pixazo.ai/flux-dev/v1/dev/textToImage" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \
-H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
--data-raw '{
  "prompt": "A futuristic city skyline at sunset with flying cars",
  "image_size": "landscape_4_3"
}'

Output

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-dev",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-dev",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Text To Image

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringThe instruction or description for the image to be generated
image_sizeNostringThe aspect ratio of the generated image, Possible enum values: square_hd, square, portrait_4_3, portrait_16_9, landscape_4_3, landscape_16_9
num_inference_stepsNointegerNumber of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster.
guidance_scaleNofloatControls how closely the output follows your prompt (prompt adherence). Higher values stick more strictly to the prompt; lower values allow more creative variation.
num_imagesNointegerThe number of images to generate
enable_safety_checkerNobooleantrue, falseTurns on automatic filtering of unsafe or explicit (NSFW) content. Leave enabled unless you have a specific reason to disable it.
output_formatNostringThe format of the generated image. Values: "jpeg", "png"
accelerationNostringThe speed of generation. Values: "none", "regular", "high"

Example Request

{
  "prompt": "A futuristic city skyline at sunset with flying cars",
  "image_size": "landscape_4_3"
}

Response

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance."
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-dev' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-dev",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-dev",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-dev_019dxxxx-xxxx/output.ext"
    ],
    "media_type": "application/octet-stream"
  },
  "created_at": "2026-03-31T10:00:00.000Z",
  "updated_at": "2026-03-31T10:00:15.000Z",
  "completed_at": "2026-03-31T10:00:15.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type of the output
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux Dev API Pricing

Your request will cost $0.025 per image.
11. Flux Fill Dev

Flux Fill Dev API Documentation

https://gateway.pixazo.ai/flux-fill-dev/v1/flux-fill/generate

Authentication

All requests require an API key passed via header.

HeaderTypeRequiredDescription
Ocp-Apim-Subscription-KeystringYesYour API subscription key

Image Generation Request - Flux Fill Dev API

Request Code

POST https://gateway.pixazo.ai/flux-fill-dev/v1/flux-fill/generate
Content-Type: application/json
Cache-Control: no-cache
Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY

{
  "prompt": "a futuristic spaceship with neon lights",
  "image": "https://example.com/photo.png",
  "mask": "https://example.com/mask.png"
}
import requests

API_KEY = "your-api-key-here"
BASE_URL = "https://gateway.pixazo.ai/flux-fill-dev/v1"

response = requests.post(
    f"{BASE_URL}/flux-fill/generate",
    headers={
        "Content-Type": "application/json",
        "Ocp-Apim-Subscription-Key": API_KEY
    },
    json={
        "prompt": "a futuristic spaceship with neon lights",
        "image": "https://example.com/photo.png",
        "mask": "https://example.com/mask.png"
    }
)

result = response.json()
print(result)
async function generateImage() {
  const response = await fetch(
    'https://gateway.pixazo.ai/flux-fill-dev/v1/flux-fill/generate',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'Ocp-Apim-Subscription-Key': process.env.API_KEY
      },
      body: JSON.stringify({
        prompt: 'a futuristic spaceship with neon lights',
        image: 'https://example.com/photo.png',
        mask: 'https://example.com/mask.png'
      })
    }
  );

  const result = await response.json();
  console.log(result);
}

generateImage();
curl -v -X POST "https://gateway.pixazo.ai/flux-fill-dev/v1/flux-fill/generate" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-cache" \
  -H "Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY" \
  --data-raw '{
    "prompt": "a futuristic spaceship with neon lights",
    "image": "https://example.com/photo.png",
    "mask": "https://example.com/mask.png"
  }'

Output

{
  "request_id": "flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Webhook (Optional)

Add the X-Webhook-URL header to your submit request to receive a POST callback when the job completes — no polling required.

Using curl? These are HTTP request headers — pass each with -H, e.g. -H "X-Webhook-URL: https://your-server.com/webhook/callback". Do not paste them as bare lines, and end every line of a multi-line command with \.

Webhook Headers

HeaderRequiredDefaultDescription
X-Webhook-URLYes (to enable)HTTPS endpoint on your server that will receive the POST callback. Must respond 2xx within a few seconds (process async if needed).
X-Webhook-ModeNoterminalterminal — fires once at the final status (COMPLETED/FAILED/ERROR). sync — fires on every poll cycle plus the terminal event, and caps the queue’s polling delay at 15s for tighter progress updates.

Example: enable webhook

X-Webhook-URL: https://your-server.com/webhook/callback
X-Webhook-Mode: terminal

Callback Payload

Your endpoint receives a POST application/json with the same shape as the GET /v2/requests/status/{request_id} response. Example terminal callback (mode terminal):

{
  "request_id": "flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-fill-dev",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-05-22T13:17:32.110Z",
  "updated_at": "2026-05-22 13:19:23",
  "completed_at": "2026-05-22 13:19:23"
}

Failure callback shape

{
  "request_id": "flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-fill-dev",
  "error": "Description of the error",
  "output": null,
  "created_at": "...",
  "updated_at": "...",
  "completed_at": "..."
}

Delivery semantics

  • terminal mode (default) — exactly one POST when the request reaches a terminal status. No callback during PROCESSING.
  • sync modePOST on every status poll (with delay capped at ~15s) plus a final POST at terminal status. Use when you want progress updates.
  • Idempotency — use request_id as your idempotency key. Network retries can deliver the same callback more than once; your handler must tolerate duplicates.
  • Response — respond 200 OK within a few seconds. The queue does not block on slow handlers, but persistent failures may stop further deliveries.
  • HTTPS required — plain http:// URLs are rejected.

Request Parameters - Image Generation Request

ParameterRequiredTypeDefaultAllowed values / rangeDescription
promptYesstringText description of what to generate in the masked area
imageYesstringURL of the source image to inpaint. Must be publicly accessible
maskYesstringURL of the mask image. White areas = fill/regenerate, black areas = preserve
seedNointegerRandom seed that controls the generation's randomness. Reuse the same seed with identical settings to reproduce the same result; leave it empty for a different output each time.
guidanceNonumber30Controls how closely the output follows your prompt (prompt adherence). Higher values stick more strictly to the prompt; lower values allow more creative variation.
num_outputsNointeger1Number of output images to generate (1-4, default: 1)
num_inference_stepsNointeger28Number of refinement steps the model runs while generating. Higher values refine detail and quality but increase processing time; lower values are faster.
megapixelsNostringOutput resolution. Values: "0.25", "1" (default), "match_input"
output_formatNostringOutput format: "webp" (default), "jpg", "png"
output_qualityNointeger80Compression quality of the saved file, from 0 (smallest file, lowest quality) to 100 (largest file, best quality). No effect on lossless formats like PNG.
lora_scaleNonumber1How strongly the selected style add-on (LoRA) is applied. Higher values make its effect more pronounced; lower values make it subtler.
disable_safety_checkerNobooleanfalsetrue, falseDisable NSFW filter (default: false)

Content Item Types & Limits

TypeMaxFormat / SizeDescription
image1JPG, PNG, WEBPImage + mask (area to fill).

Example Request

{
  "prompt": "a futuristic spaceship with neon lights",
  "image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/recraft/a-red-cat-1781619282400-0.webp",
  "mask": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/seedream-5-0-lite-text-to-image_019ecace-485b-7447-c8d1-ce0344929afed/output.png",
  "seed": 42,
  "guidance": 35,
  "num_outputs": 2,
  "num_inference_steps": 35,
  "output_format": "png",
  "output_quality": 95
}

Response

{
  "request_id": "flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "QUEUED",
  "polling_url": "https://gateway.pixazo.ai/v2/requests/status/flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Request Headers

Header Value
Content-Typeapplication/json
Cache-Controlno-cache
Ocp-Apim-Subscription-KeyYOUR_SUBSCRIPTION_KEY

Response Handling

Common status codes.

CodeMeaning
202Accepted — Request queued
Bad Request
401Unauthorized
402Insufficient Balance
403Forbidden
Too Many Requests
500Internal Server Error

Error Responses

Queue system errors and model validation errors.

Queue System Errors

// 402 — Insufficient balance
{
  "error": "Insufficient Balance",
  "message": "Your wallet does not have enough balance. Required: $0.01"
}
// 400 — Model not found
{
  "error": "Model not found",
  "message": "Model 'flux-fill-dev' not found or is disabled"
}

Error via Status/Webhook

{
  "request_id": "flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "ERROR",
  "model_id": "flux-fill-dev",
  "error": "Description of the error",
  "output": null
}

Retrieving Results

Poll the universal status endpoint to check progress and retrieve results.

Endpoint

GET https://gateway.pixazo.ai/v2/requests/status/{request_id}
Ocp-Apim-Subscription-Key: YOUR_API_KEY

cURL Example

curl -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://gateway.pixazo.ai/v2/requests/status/flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Response (Completed)

{
  "request_id": "flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "status": "COMPLETED",
  "model_id": "flux-fill-dev",
  "error": null,
  "output": {
    "media_url": [
      "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/v1/flux-fill-dev_019dxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/output.png"
    ],
    "media_type": "image/png"
  },
  "created_at": "2026-04-14T10:00:00.000Z",
  "updated_at": "2026-04-14T10:00:30.000Z",
  "completed_at": "2026-04-14T10:00:30.000Z"
}

Response Fields

FieldTypeDescription
request_idstringUnique request identifier
statusstringQUEUED, PROCESSING, COMPLETED, FAILED, or ERROR
model_idstringModel that processed the request
errorstring|nullError message if failed
output.media_urlarrayURLs to generated media (R2 CDN)
output.media_typestringMIME type (image/png)
created_atstringWhen request was created
completed_atstring|nullWhen request completed
polling_urlstringStatus URL (initial response only)

Status Values

StatusDescription
QUEUEDRequest accepted, waiting to be processed
PROCESSINGBeing processed by the model
COMPLETEDDone — output contains the result
FAILEDFailed — check error field
ERRORSystem error — not charged

Status Flow

QUEUED → PROCESSING → COMPLETED
                    → FAILED
                    → ERROR

Typical Workflow

  1. Send a generate request to the API endpoint
  2. Save the request_id from the response
  3. Poll every 5-10 seconds: GET /v2/requests/status/{request_id}
  4. When status is "COMPLETED", download from output.media_url

Tip: Use X-Webhook-URL header to get a callback instead of polling.

Flux Fill Dev API Pricing

Your request will cost $0.04 per image.