Flux Schnell
Basic API Configuration
Base URL: https://api.foxaihub.com/api/v2
Headers Parameters:
{
"api-key": "Your API Key",
}
注意
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 Name | Type | Description | Remarks |
---|---|---|---|
prompt | String | Text description of the image to generate | Required. The prompt should describe the desired image in detail |
width | Number | Width of the output image in pixels | Optional. Default is 1024. Must be between 128 and 1024 pixels |
height | Number | Height of the output image in pixels | Optional. Default is 1024. Must be between 128 and 1024 pixels |
steps | Number | Number of steps in the generation process | Optional. Default is 4. Must be between 4 and 8 steps |
number | Number | Number of images to generate | Optional. 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 Name | Type | Description | Remarks |
---|---|---|---|
ids | String | Task ID to query | Required. 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"
}
]