# Flux API

> Provider: **Black Forest Labs**
> Source: https://www.pixazo.ai/models/flux

Flux is a state-of-the-art text-to-image model that generates high-quality images from text descriptions.

## Flux 2 Pro

### Image to Image (Image Editing)

## Base URL

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

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Generate Request - flux 2 pro Image to Image API

## Request Code

HTTP Python JavaScript cURL

```
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": true,
  "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": True,
    "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: true,
  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": true,
    "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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-2-pro-image-to-image-866&operation=flux-2-pro-image-to-image-request)

## 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 - Generate Request

Parameter

Required

Type

Description

prompt

Yes

string

A descriptive text prompt guiding the image transformation (e.g., style, lighting, elements to add or remove)

image\_urls

Yes

array\[string\]

One or more publicly accessible image URLs to be edited. Only the first image will be processed if multiple are provided.

image\_size

No

string

Dimensions of the output image. Use "auto" to preserve input dimensions, or specify "512x512", "1024x1024", etc.

safety\_tolerance

No

string

Controls sensitivity of content moderation. Higher values allow more permissive outputs. Accepts "1" (strict), "2" (moderate), "3" (relaxed).

enable\_safety\_checker

No

boolean

Enables or disables content safety filtering. When false, safety checks are bypassed (use with caution).

output\_format

No

string

Format of the generated image output. Supported values: "jpeg", "png", "webp"

## Example Request

```
{
  "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": true,
  "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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal 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

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System 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.

### Image to Image (LoRA Trainer)

## Base URL

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

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Generate Request - flux 2 pro Image to Image Trainer API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-2-pro-image-to-image-trainer-831&operation=flux-2-pro-image-to-image-trainer-request)

## 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 - Generate Request

Parameter

Required

Type

Description

image\_data\_url

Yes

string

Base64-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.

steps

No

integer

Number of training steps to perform. Higher values yield more refined models but require longer processing time.

learning\_rate

No

number

Learning rate for the LoRA fine-tuning process. A lower value provides more stable training; higher values may converge faster but risk overfitting.

## Example Request

```
{
  "image_data_url": "https://example.com/images/reference_style.jpg",
  "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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal 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

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System 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.

### Text to Image

## Base URL

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

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Generate Request - flux 2 pro Text to Image API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-2-pro-text-to-image-799&operation=flux-2-pro-text-to-image-request)

## 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 - Generate Request

Parameter

Required

Type

Description

prompt

Yes

string

A detailed text description of the desired image. Be specific about subject, style, lighting, composition, and mood.

image\_size

No

string

The 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\_tolerance

No

integer

Controls sensitivity of the safety filter. Lower values (1-2) are more restrictive; higher values (3-4) allow more expressive content.

enable\_safety\_checker

No

boolean

Whether to enable content safety filtering. Disabling may expose you to inappropriate content and is not recommended for public applications.

output\_format

No

string

The 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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal 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

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System 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.

### Image to Image (LoRA Trainer)

## Base URL

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

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Generate Request - flux 2 pro Text to Image Trainer API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-2-pro-text-to-image-trainer-712&operation=flux-2-pro-text-to-image-trainer-request)

## 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 - Generate Request

Parameter

Required

Type

Description

image\_data\_url

Yes

string

Base64-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.

steps

No

integer

Number of training steps to perform. Higher values improve model quality but increase training time.

learning\_rate

No

number

Learning rate for the LoRA adapter training process. Lower values ensure stable convergence; higher values may speed up training but risk instability.

## Example Request

```
{
  "image_data_url": "https://example.com/dataset.zip",
  "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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal 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

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System 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

### Image Restoration

## Base URL

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

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Image Restore Request - Flux Kontext Restore Image

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-kontext-restore-image&operation=image-restore-request)

## 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 Kontext Restore Image

Parameter

Required

Type

Default

Description

input\_image

Yes

string (URL)

—

Publicly accessible URL of the image to restore. Supported formats: `jpeg`, `png`, `gif`, `webp`.

seed

No

integer

random

Random seed for reproducible generation. Must be a non-negative integer (≥ 0).

output\_format

No

string

"png"

Output image format. Allowed values: `jpg`, `png`.

safety\_tolerance

No

integer

2

Content safety threshold. Allowed values: `0`–`2`. `0` is the strictest, `2` the most permissive (max allowed).

## Example Request

```
{
  "input_image": "https://pub-582b7213209642b9b995c96c95a30381.r2.dev/input_model.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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal 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

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type (image/png or image/jpeg)

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System 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 Klein

### Text to Image

## Text to Image - Flux 2 klein 4b

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-2-klein-4b-api&operation=text-to-image)

## Request Parameters - Text to Image

Parameter

Required

Type

Description

prompt

Yes

string

The text query that instructs the AI model on what kind of content to generate.

steps

No

integer

The number of diffusion steps; higher values can improve quality but take longer. Default: 25

width

No

integer

The desired width of the generated image, specified in pixels. Default: 1024. Supported sizes: 512, 1024, 1448, 2048

height

No

integer

The 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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes for Text to Image.

Code

Meaning

200

Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

Too Many Requests

500

Internal Server Error

## Flux 2 Dev

### Text to Image

## generateT2I - Flux 2 dev API

## Request Code

HTTP Python JavaScript cURL

```
POST https://gateway.pixazo.ai/generateT2I
Content-Type: application/json
X-Secret-Key: YOUR_SECRET_KEY

{
  "prompt": "a sunset at the alps",
  "steps": 25,
  "width": 1024,
  "height": 1024
}
```

```
import requests

url = "https://gateway.pixazo.ai/generateT2I"
headers = {
    "Content-Type": "application/json",
    "X-Secret-Key": "YOUR_SECRET_KEY"
}
data = {
    "prompt": "a sunset at the alps",
    "steps": 25,
    "width": 1024,
    "height": 1024
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
```

```
const url = 'https://gateway.pixazo.ai/generateT2I';
const headers = {
  'Content-Type': 'application/json',
  'X-Secret-Key': 'YOUR_SECRET_KEY'
};
const body = {
  prompt: 'a sunset at the alps',
  steps: 25,
  width: 1024,
  height: 1024
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(body)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
```

```
curl -v -X POST "https://gateway.pixazo.ai/generateT2I" \
  -H "Content-Type: application/json" \
  -H "X-Secret-Key: YOUR_SECRET_KEY" \
  --data-raw '{
    "prompt": "a sunset at the alps",
    "steps": 25,
    "width": 1024,
    "height": 1024
  }'
```

## Output

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

[Try Now](https://api.pixazo.ai/api-details#api=flux-2-dev-api&operation=generatet2i)

## Request Parameters - generateT2I

Parameter

Required

Type

Description

prompt

Yes

string

The 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 (e.g., "fingers brushing lips" is converted to "hand near face").

steps

No

integer

Number of inference steps for image generation. Controls the quality and detail level of the generated image. Higher values may produce more refined results but take longer to generate.

width

No

integer

Width of the generated image in pixels. Must be a positive integer. Recommended values: 512, 768, 1024, 1280, 1536, 2048.

height

No

integer

Height of the generated image in pixels. Must be a positive integer. Recommended values: 512, 768, 1024, 1280, 1536, 2048.

## Example Request

```
{
  "prompt": "a sunset at the alps",
  "steps": 25,
  "width": 1024,
  "height": 1024
}
```

## Response

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

## Request Headers

Header

Value

Content-Type

application/json

X-Secret-Key

YOUR\_SECRET\_KEY

## Response Handling

Common status codes for generateT2I.

Code

Meaning

200

Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

Too Many Requests

500

Internal Server Error

## Flux Pro 1.1

### Text to Image

## Base URL

```
https://gateway.pixazo.ai/pro1.1/v1
```

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Pro1.1 Ultra generateRequest - Flux pro 1.1

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-pro-1-1&operation=pro1-1-ultra-generaterequest)

## 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 - Pro1.1 Ultra generateRequest

Parameter

Required

Type

Description

prompt

Yes

string

The 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

seed

Optional

integer

The same seed and prompt will output the same image every time

sync\_mode

Optional

boolean

If true, waits for image generation and upload before returning response. Increases latency but provides direct image access without CDN

num\_images

Optional

integer

The number of images to generate

enable\_safety\_checker

Optional

boolean

Whether to enable the safety checker to filter NSFW content

output\_format

Optional

string

The format of the generated image. Values: "jpeg", "png"

safety\_tolerance

Optional

string

The safety tolerance level for generated images. 1 is most strict, 6 is most permissive. Values: "1", "2", "3", "4", "5", "6"

enhance\_prompt

Optional

boolean

Whether to enhance the prompt for better results

aspect\_ratio

Optional

string

The 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"

raw

Optional

boolean

Generate 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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal 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

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System 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 1 Schnell

### Text to Image

## Get Image - flux-1 Schnell API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-1-schnell&operation=get-image)

## Request Parameters - Get Image

Parameter

Required

Type

Description

prompt

Yes

string

The text query that instructs the AI model on what kind of content to generate.

num\_steps

No

integer

The number of diffusion steps; higher values can improve quality but take longer. Default: 4, Maximum: 8

seed

No

integer

A "seed" is used to generate a consistent sequence of pseudo-random numbers, aiding reproducibility.

height

No

integer

The desired height of the generated image, specified in pixels. Default: 1024

width

No

integer

The 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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes for Get Image.

Code

Meaning

200

Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

Too Many Requests

500

Internal Server Error

### Text to Image (Batch)

## Get Image Batch - flux-1 Schnell API

## Request Code

HTTP Python JavaScript cURL

```
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 {...}"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-1-schnell&operation=get-image-batch)

## Request Parameters - Get Image Batch

Parameter

Required

Type

Description

prompt

Yes

string

The 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\_steps

No

integer

Number of inference steps for image generation. FLUX-1-Schnell is optimized for speed, so values between 1-4 are typical.

seed

No

integer

Random seed for reproducible image generation. Use the same seed to generate similar images. If not provided, a random seed is generated.

width

No

integer

Width of the generated image in pixels. Recommended values: 512, 768, 1024, 1280, 1536, 1920.

height

No

integer

Height of the generated image in pixels. Recommended values: 512, 768, 1024, 1280, 1536, 1920.

webhook\_url

No

string

URL 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-Type

application/json

X-Secret-Key

YOUR\_SECRET\_KEY

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes for Get Image Batch.

Code

Meaning

200

Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

429

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

HTTP Python JavaScript cURL

```
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 Pro

### Text to Image

## Base URL

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

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Text To Image - Flux Pro API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-pro&operation=text-to-image)

## 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 - Text To Image

Parameter

Required

Type

Description

prompt

Yes

string

The instruction or description for the image to be generated

image\_size

Optional

string

The 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\_steps

Optional

integer

The number of denoising steps. Higher values result in higher quality images but take longer to generate

guidance\_scale

Optional

float

Controls how closely the model follows the prompt. Higher values make the model adhere more closely to the prompt

num\_images

Optional

integer

The number of images to generate

enable\_safety\_checker

Optional

boolean

Whether to enable the safety checker to filter NSFW content

output\_format

Optional

string

The 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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal 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

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System 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

### Image to Image (Image Editing)

## Base URL

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

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Image To Image - flux Dev API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-dev&operation=image-to-image)

## 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 - Image To Image

Parameter

Required

Type

Description

image\_url

Yes

string

The URL of the source image to transform

prompt

Yes

string

The instruction or description for how to transform the image

strength

Optional

float

The strength of the transformation. Higher values result in more dramatic changes

num\_inference\_steps

Optional

integer

The number of denoising steps. Higher values result in higher quality images but take longer to generate

guidance\_scale

Optional

float

Controls how closely the model follows the prompt. Higher values make the model adhere more closely to the prompt

num\_images

Optional

integer

The number of images to generate

enable\_safety\_checker

Optional

boolean

Whether to enable the safety checker to filter NSFW content

output\_format

Optional

string

The format of the generated image. Values: "jpeg", "png"

acceleration

Optional

string

The speed of generation. Values: "none", "regular", "high"

## 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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal 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

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System 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.

### Text to Image

## Base URL

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

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Text To Image - flux Dev API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-dev&operation=text-to-image)

## 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 - Text To Image

Parameter

Required

Type

Description

prompt

Yes

string

The instruction or description for the image to be generated

image\_size

No

string

The 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\_steps

No

integer

The number of denoising steps. Higher values result in higher quality images but take longer to generate

guidance\_scale

No

float

Controls how closely the model follows the prompt. Higher values make the model adhere more closely to the prompt

num\_images

No

integer

The number of images to generate

enable\_safety\_checker

No

boolean

Whether to enable the safety checker to filter NSFW content

output\_format

No

string

The format of the generated image. Values: "jpeg", "png"

acceleration

No

string

The 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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal 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

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type of the output

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System 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

### Image to Image (Image Editing — Inpainting)

## Base URL

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

## Authentication

All requests require an API key passed via header.

Header

Type

Required

Description

Ocp-Apim-Subscription-Key

string

Yes

Your API subscription key

## Image Generation Request - Flux Fill Dev API

## Request Code

HTTP Python JavaScript cURL

```
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"
}
```

[Try Now](https://api.pixazo.ai/api-details#api=flux-fill-dev&operation=image-generation-request)

## 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 - Image Generation Request

Parameter

Required

Type

Description

prompt

Yes

string

Text description of what to generate in the masked area

image

Yes

string

URL of the source image to inpaint. Must be publicly accessible

mask

Yes

string

URL of the mask image. White areas = fill/regenerate, black areas = preserve

seed

No

integer

Random seed for reproducible results

guidance

No

number

Guidance scale for prompt adherence (default: 30)

num\_outputs

No

integer

Number of output images to generate (1-4, default: 1)

num\_inference\_steps

No

integer

Number of denoising steps (default: 28). Higher = better quality but slower

megapixels

No

string

Output resolution. Values: "0.25", "1" (default), "match\_input"

output\_format

No

string

Output format: "webp" (default), "jpg", "png"

output\_quality

No

integer

Output quality 0-100 (default: 80)

lora\_scale

No

number

LoRA adapter strength (default: 1)

disable\_safety\_checker

No

boolean

Disable NSFW filter (default: false)

## Example Request

```
{
  "prompt": "a futuristic spaceship with neon lights",
  "image": "https://example.com/photo.png",
  "mask": "https://example.com/mask.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-Type

application/json

Cache-Control

no-cache

Ocp-Apim-Subscription-Key

YOUR\_SUBSCRIPTION\_KEY

## Response Handling

Common status codes.

Code

Meaning

202

Accepted — Request queued

400

Bad Request

401

Unauthorized

402

Insufficient Balance

403

Forbidden

429

Too Many Requests

500

Internal 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

Field

Type

Description

request\_id

string

Unique request identifier

status

string

QUEUED, PROCESSING, COMPLETED, FAILED, or ERROR

model\_id

string

Model that processed the request

error

string|null

Error message if failed

output.media\_url

array

URLs to generated media (R2 CDN)

output.media\_type

string

MIME type (image/png)

created\_at

string

When request was created

completed\_at

string|null

When request completed

polling\_url

string

Status URL (initial response only)

## Status Values

Status

Description

QUEUED

Request accepted, waiting to be processed

PROCESSING

Being processed by the model

COMPLETED

Done — output contains the result

FAILED

Failed — check error field

ERROR

System 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.
