Flux Schnell API

FLUX.1 [schnell] is a 12 billion parameter rectified flow transformer capable of generating images from text descriptions.

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.

Flux Schnell Task

Path: /flux-schnell/task

Method: POST

Type: application/json

Parameters:

Parameter Name Type Description Remarks
prompt String Text prompt used to initiate or guide the generation process Required
height Number Desired height, in pixels, of the generated image Required. Valid range: [128, 1024]
width Number Desired width, in pixels, of the generated image Required. Valid range: [128, 1024]
steps Number Number of denoising iterations the diffusion model will run Optional. Valid range: [4, 8]. Default: 4
number Number How many separate images to produce per request Optional. Valid range: [1, 8]. Default: 1

Example Request:

POST {{base_url}}/flux-schnell/task HTTP/1.1
Content-Type: application/json
api-key: {{api_key}}

{
    "prompt": "Illustrate bottle pouring in the colorful, abstract expressionist style of Alexej von Jawlensky.\r\nUse bold brushstrokes, saturated color fields, and stylized facial features.\r\nEmphasize inner emotional or spiritual states rather than realistic likeness.\r\nFinal look: vibrant, symbolic, and spiritually expressive.",
    "width": 750,
    "height": 1000,
    "steps": 8,
    "number": 1
}

Example Response:

{
  "success": true,
  "status": "pending",
  "task_id": "01995080-ed3e-7000-a10d-99bfb9a4040c",
  "gen_params": {
    "prompt": "Illustrate bottle pouring in the colorful, abstract expressionist style of Alexej von Jawlensky.\r\nUse bold brushstrokes, saturated color fields, and stylized facial features.\r\nEmphasize inner emotional or spiritual states rather than realistic likeness.\r\nFinal look: vibrant, symbolic, and spiritually expressive.",
    "height": 1000,
    "width": 750,
    "steps": 8,
    "number": 1
  },
  "data": {},
  "created_at": "2025-09-16T03:10:50.704Z"
}

Query task status

Example Request:

GET {{base_url}}/flux-schnell/task?ids=01995080-ed3e-7000-a10d-99bfb9a4040c HTTP/1.1
Content-Type: application/json
api-key: {{api_key}}

Response

[
  {
    "status": "completed",
    "task_id": "01995080-ed3e-7000-a10d-99bfb9a4040c",
    "gen_params": {
      "steps": 8,
      "width": 750,
      "height": 1000,
      "number": 1,
      "prompt": "Illustrate bottle pouring in the colorful, abstract expressionist style of Alexej von Jawlensky.\r\nUse bold brushstrokes, saturated color fields, and stylized facial features.\r\nEmphasize inner emotional or spiritual states rather than realistic likeness.\r\nFinal look: vibrant, symbolic, and spiritually expressive."
    },
    "data": [
      "https://cdn2.foxai.me/flux-schnell/19c7dd54-0dcf-4368-ab65-0f7c92f49d3e.jpg"
    ],
    "created_at": "2025-09-16T03:10:50.000Z"
  }
]