Z-Image API Playground
Generate stunning AI images with our powerful Z-Image API
Prompt
Enter a detailed description of the image you want to generate.
Options
Why Choose FoxAIHub?
Half the price, double the value
| Provider | Cost per Megapixel | Speed | $1 Gets You |
|---|---|---|---|
| fal.ai | $0.005 | 1.56s | 200 images |
| Replicate | $0.005 | 2.12s | 200 images |
| $0.0025(-50%) | 2.51s | 400 images(2x) |
fal.ai
Cost/MP
$0.005
Speed
1.56s
$1 =
200 imgs
Replicate
Cost/MP
$0.005
Speed
2.12s
$1 =
200 imgs
BEST VALUE
Cost/MP
$0.0025
-50%
Speed
2.51s
$1 =
400 imgs
2x more
Save 50% compared to other providers
* Generation speed depends on the steps parameter. Higher steps produce clearer, higher-quality images but take longer to generate.
Z Image API Document
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.
:::
Pricing
$0.0025 per generation
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.
Z Image Turbo Task
Path: /aigc/task
Method: POST
Type: application/json
Parameters
| Parameter Name | Type | Description | Remarks |
|---|---|---|---|
| task_type | String | Task type identifier | Required. Must be "z_image_turbo" |
| params | Object | Generation parameters object | Required |
| params.prompt | String | Text prompt used to guide the image generation process | Required |
| params.negative_prompt | String | Text describing elements to exclude from the generated image | Optional. Default: "" |
| params.height | Number | Desired height, in pixels, of the generated image | Required. Recommended: [1, 1536] |
| params.width | Number | Desired width, in pixels, of the generated image | Required. Recommended: [1, 1536] |
| params.steps | Number | Number of denoising iterations the diffusion model will run | Optional. Default: 5 |
| batch_size | Number | How many separate images to produce per request | Optional. Valid range: [1, 4]. Default: 1 |
The range of Steps is 4-9. Higher steps result in slower image generation, but also higher image quality.
Example Request
POST {{base_url}}/aigc/task HTTP/1.1
Content-Type: application/json
api-key: {{api_key}}
{
"task_type": "z_image_turbo",
"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.",
"negative_prompt": "",
"height": 1024,
"width": 1024,
"steps": 5
},
"batch_size": 2
}
Example Response
{
"success": true,
"task_id": "019add2a-9e3e-7000-96bd-cee7b41bdd2f"
}
Query Task Status
Path: /aigc/task
Method: GET
Type: application/json
Query Parameters
| Parameter Name | Type | Description | Remarks |
|---|---|---|---|
| ids | String | Task ID(s) to query. Multiple IDs can be comma-separated | Required |
Example Request
GET {{base_url}}/aigc/task?ids=019add29-ab83-7000-81e1-8d93c6cbaebb HTTP/1.1
Content-Type: application/json
api-key: {{api_key}}
Example Response (Processing)
[
{
"id": 16186,
"user_id": 1,
"task_id": "019add29-ab83-7000-81e1-8d93c6cbaebb",
"task_type": "z_image_turbo",
"status": "processing",
"params": {
"steps": 5,
"width": 1024,
"height": 1024,
"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.",
"batch_size": 2,
"negative_prompt": ""
},
"data": null,
"data1": null,
"data2": null,
"priority": 0,
"created_at": "2025-12-02T03:44:47.000Z"
}
]
Example Response (Completed)
[
{
"id": 16186,
"user_id": 1,
"task_id": "019add29-ab83-7000-81e1-8d93c6cbaebb",
"task_type": "z_image_turbo",
"status": "completed",
"params": {
"steps": 5,
"width": 1024,
"height": 1024,
"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.",
"batch_size": 2,
"negative_prompt": ""
},
"data": [
"https://cdnfy.foxai.me/019add29-ab83-7000-81e1-8d93c6cbaebb_0.png",
"https://cdnfy.foxai.me/019add29-ab83-7000-81e1-8d93c6cbaebb_1.png"
],
"data1": null,
"data2": null,
"priority": 0,
"created_at": "2025-12-02T03:44:47.000Z"
}
]
Task Status Values
| Status | Description |
|---|---|
processing |
Task is currently being processed |
completed |
Task has finished successfully, image URLs available in data array |
failed |
Task failed to complete |