Skip to main content

Flux Schnell

Basic API Configuration

Base URL: https://api.foxaihub.com/api/v2

Headers Parameters:

{
"api-key": "Your API Key",
}
warning

The parameter is api-key instead of api_key.

Notes

The images generated by this API will only be saved for 24 hours, after which they will be deleted by the system. At that time, you will not be able to access the image via the URL.

Create Flux-Schnell task

Path: /flux-schnell/task

Method: POST

Type: application/json

Parameters:

Parameter NameTypeDescriptionRemarks
promptStringText description of the image to generateRequired. The prompt should describe the desired image in detail
widthNumberWidth of the output image in pixelsOptional. Default is 1024. Must be between 128 and 1024 pixels
heightNumberHeight of the output image in pixelsOptional. Default is 1024. Must be between 128 and 1024 pixels
stepsNumberNumber of steps in the generation processOptional. Default is 4. Must be between 4 and 8 steps
numberNumberNumber of images to generateOptional. Default is 1. Must be between 1 and 8 images

Example Request:

POST /flux-schnell/task HTTP/1.1
Content-Type: application/json
api-key: your_api_key_here

{
"prompt": "Pirate ship trapped in a cosmic maelstrom nebula, rendered in cosmic beach whirlpool engine, volumetric lighting, spectacular, ambient lights, light pollution, cinematic atmosphere, art nouveau style, illustration art artwork by SenseiJaye, intricate detail.",
"width": 1024,
"height": 1024,
"steps": 8,
"number": 2
}

Example Response:

{
"success": true,
"status": "pending",
"task_id": "019657ff-0313-7000-92b4-62a523a96152",
"gen_params": {
"prompt": "Pirate ship trapped in a cosmic maelstrom nebula, rendered in cosmic beach whirlpool engine, volumetric lighting, spectacular, ambient lights, light pollution, cinematic atmosphere, art nouveau style, illustration art artwork by SenseiJaye, intricate detail.",
"height": 1024,
"width": 1024,
"steps": 8,
"number": 2
},
"data": {},
"created_at": "2025-04-21T10:57:32.452Z"
}

Query Task Status

Path: /flux-schnell/task

Method: GET

Type: application/json

Query Parameters:

Parameter NameTypeDescriptionRemarks
idsStringTask ID to queryRequired. Can be obtained from the create task response, allow mutil ids, spilit by comma,

Example Request:

GET /flux-schnell/task?ids=019657fa-320d-7000-8661-879c56a19144,119657fa-320d-7000-8661-879c56a19149 HTTP/1.1
Content-Type: application/json
api-key: your_api_key_here

Example Response:

[
{
"status": "completed",
"task_id": "019657fa-320d-7000-8661-879c56a19144",
"gen_params": {
"steps": 4,
"width": 1024,
"height": 1024,
"number": 1,
"prompt": "Pirate ship trapped in a cosmic maelstrom nebula, rendered in cosmic beach whirlpool engine, volumetric lighting, spectacular, ambient lights, light pollution, cinematic atmosphere, art nouveau style, illustration art artwork by SenseiJaye, intricate detail."
},
"data": [
"https://cdn2.foxai.me/flux-schnell-images/56ce02f7-dc16-4b33-b984-3972bdce0332.png"
],
"created_at": "2025-04-21T10:52:16.000Z"
}
]