curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "z-image-turbo",
prompt: "Ink painting style landscape scenery",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance, please top up",
"type": "payment_required"
}
}
Z-Image-Turbo
Z-Image-Turbo Image Generation
- Asynchronous processing mode, returns task ID for subsequent queries
- Lightweight and fast image generation, supports Chinese and English
- Supports 1K/2K resolution tiers, supports smart prompt rewriting
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "z-image-turbo",
prompt: "Ink painting style landscape scenery",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance, please top up",
"type": "payment_required"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "z-image-turbo",
prompt: "Ink painting style landscape scenery",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient balance, please top up",
"type": "payment_required"
}
}
Supported Models
| Model | Description | Images Per Request | Pricing |
|---|---|---|---|
z-image-turbo | Lightweight and fast image generation, supports Chinese and English | Fixed 1 image | Fixed price |
Authorizations
string
required
All endpoints require Bearer Token authenticationGet API Key:Visit API Key Management to get your API KeyAdd to request header:
Authorization: Bearer YOUR_API_KEY
Body
string
required
Model name
z-image-turbo- Lightweight and fast image generation, supports Chinese and English
boolean
default:"false"
Whether to run content moderation before submitting the image task.
true: useomni-moderation-latestto review prompts and input imagesfalseor omitted: do not send a moderation request, adding no moderation cost or latency (default)
string
required
Text description for image generation, up to 800 characters
string
default:"1:1"
Image aspect ratioSupported aspect ratios:
1:1- Square (default)4:3- Landscape 4:33:4- Portrait 3:416:9- Landscape widescreen9:16- Portrait vertical3:2- Landscape 3:22:3- Portrait 2:3
string
default:"1K"
Resolution tier
1K- Standard resolution (default)2K- High definition resolution
boolean
default:"false"
Smart prompt rewritingWhen enabled, AI will automatically optimize the prompt for better results, and costs will increase.
false- Disabled (default)true- Enabled
Resolution Reference Table
Output size is controlled by the combination ofsize (ratio) + resolution (resolution tier).
| Ratio | 1K Tier | 2K Tier |
|---|---|---|
1:1 | 1024×1024 | 2048×2048 |
4:3 | 1152×864 | 2048×1536 |
3:4 | 864×1152 | 1536×2048 |
16:9 | 1280×720 | 2048×1152 |
9:16 | 720×1280 | 1152×2048 |
3:2 | 1248×832 | 2048×1360 |
2:3 | 832×1248 | 1360×2048 |
Usage Examples
Basic Text-to-Image (minimal request){
"model": "z-image-turbo",
"prompt": "Ink painting style landscape scenery"
}
{
"model": "z-image-turbo",
"prompt": "Minimalist style cafe interior design",
"size": "16:9",
"resolution": "2K"
}
{
"model": "z-image-turbo",
"prompt": "A cat",
"prompt_extend": true
}
Response
integer
Response status code
array
Notes
- Asynchronous Processing: After submission, a
task_idis returned. Poll/v1/tasks/{task_id}to get results - Image Storage: Generated images are mirrored to platform CDN and are valid long-term
- Billing Rules: Billed per successfully generated image, no charge for failures
- Fixed Count: Z-Image-Turbo generates exactly 1 image per request,
nparameter is not supported