Documentation Index
Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Flux Kontext is a Black Forest Labs image model for prompt-based image generation and reference-guided image editing. Use this page when you are ready to call the API after trying the model in the APIXO playground.| Capability | Value |
|---|---|
| Model ID | flux-kontext |
| Modes | pro, max |
| Workflows | text-to-image, image-to-image |
| Prompt length | 1-10000 characters |
| Reference images | Optional, 1 image URL |
| Aspect ratios | 1:1, 4:3, 3:4, 9:16, 16:9, 21:9 |
| Output formats | jpeg, png |
Endpoint and authentication
Base URL:| Method | Endpoint | Purpose |
|---|---|---|
POST | /generateTask/flux-kontext | Submit a generation task |
GET | /statusTask/flux-kontext?taskId={taskId} | Poll task status and retrieve results |
Copy-paste async quickstart
This minimal request submits a text-to-image task and returns ataskId.
taskId; you need it to poll for the final result.
Poll for result
resultJson after state becomes success:
Request body
Text-to-image
Image-to-image
Parameters
Result delivery mode. Use
async for polling with statusTask, or callback for webhook delivery.Required when
request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.Flux Kontext input parameters.
Response format
Submit task response
POST /generateTask/flux-kontext returns a task ID when the task is accepted:
API status code.
200 means the task was accepted.Human-readable status message.
Unique task identifier used with the status endpoint.
Status response fields
Unique task identifier.
Current task state:
pending, processing, success, or failed.JSON string containing the generated image URLs. Present when
state is success.Machine-readable failure code. Present when
state is failed.Human-readable failure message. Present when
state is failed.Task creation timestamp in Unix milliseconds.
Task completion timestamp in Unix milliseconds. Present after completion.
Processing duration in milliseconds. Present after completion when available.
Webhook callback mode
Use callback mode when your backend should receive the final result automatically instead of polling.Billing
Flux Kontext is billed per generated image. The selectedmode determines the unit price.
| Mode | APIXO price | Market reference |
|---|---|---|
pro | $0.03 / image | $0.04 / image |
max | $0.06 / image | $0.08 / image |
Latency and polling
Actual latency may vary by prompt complexity, reference image accessibility, provider route, and current queue load.| Mode | Typical generation time | Recommended first poll | Poll interval |
|---|---|---|---|
pro | Around 30s | 20s after task creation | 3s-5s |
max | Around 30s or longer | 20s after task creation | 3s-5s |
429, slow down requests and retry with backoff. For account-level details, see System APIs.
Errors and troubleshooting
HTTP errors
| Code | Meaning | What to do |
|---|---|---|
400 | Invalid request body, missing parameter, unsupported value, or unreachable image URL | Fix the request before retrying |
401 | Missing or invalid API key | Check the Authorization header |
402 | Insufficient balance or quota | Add balance or switch account/key |
403 | Key or route cannot access the model | Check permissions and route strategy |
429 | Rate limit or concurrency limit reached | Retry with exponential backoff |
500 | Server error or unmapped provider failure | Retry with backoff |
502 | Upstream provider error | Retry with backoff |
504 | Upstream timeout | Retry or use callback mode for long-running jobs |
Parameter validation
| Field | Requirement |
|---|---|
input.mode | Required. Must be pro or max. |
input.prompt | Required string. Must not be empty and cannot exceed 10000 characters. |
input.aspect_ratio | Required. Must be 1:1, 4:3, 3:4, 9:16, 16:9, or 21:9. |
input.image_urls | Optional array. If present, it cannot be empty and cannot contain more than 1 image URL. |
input.output_format | Optional. Must be jpeg or png. |
input.safetyTolerance | Optional integer. Must be 0, 1, or 2. |
Task failure codes
| Fail code | Meaning | What to do |
|---|---|---|
ImageNotAccess | A reference image URL could not be fetched or was not a public HTTP(S) URL | Use a public, direct image URL |
PromptInvalid | Prompt was rejected or malformed | Change the prompt and retry |
SensitiveContent | Prompt or reference image failed provider safety checks | Change the prompt or input image |
RateLimited | Provider-side rate limit reached | Retry with exponential backoff |
Timeout | Provider-side timeout | Retry, reduce input complexity, or use callback mode |
Unknown error | Provider returned an unmapped failure | Retry with backoff or contact support with the taskId |