Create Generation Task
curl --request POST \
--url https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"width": 1024,
"height": 1024,
"seed": 0,
"prompt_extend": false
}
'import requests
url = "https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation"
payload = {
"prompt": "<string>",
"width": 1024,
"height": 1024,
"seed": 0,
"prompt_extend": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({prompt: '<string>', width: 1024, height: 1024, seed: 0, prompt_extend: false})
};
fetch('https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'width' => 1024,
'height' => 1024,
'seed' => 0,
'prompt_extend' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": 0,\n \"prompt_extend\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": 0,\n \"prompt_extend\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": 0,\n \"prompt_extend\": false\n}"
response = http.request(request)
puts response.read_body{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "failed",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"error": {
"code": 3001,
"title": "Invalid Request",
"detail": "Task execution failed"
}
}
}Z-Image Spicy Pro Text-To-Image Generation
Generate an image from a text prompt using the Z-Image Spicy Pro model.
POST
/
vendors
/
carrothub
/
v1
/
z-image-spicy-pro
/
generation
Create Generation Task
curl --request POST \
--url https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"width": 1024,
"height": 1024,
"seed": 0,
"prompt_extend": false
}
'import requests
url = "https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation"
payload = {
"prompt": "<string>",
"width": 1024,
"height": 1024,
"seed": 0,
"prompt_extend": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({prompt: '<string>', width: 1024, height: 1024, seed: 0, prompt_extend: false})
};
fetch('https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'width' => 1024,
'height' => 1024,
'seed' => 0,
'prompt_extend' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": 0,\n \"prompt_extend\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": 0,\n \"prompt_extend\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mulerouter.ai/vendors/carrothub/v1/z-image-spicy-pro/generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"width\": 1024,\n \"height\": 1024,\n \"seed\": 0,\n \"prompt_extend\": false\n}"
response = http.request(request)
puts response.read_body{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"task_info": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "failed",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"error": {
"code": 3001,
"title": "Invalid Request",
"detail": "Task execution failed"
}
}
}Overview
Generate images from text prompts using the Z-Image Spicy Pro model (z-image-spicy-pro) with custom dimensions and optional prompt rewriting.
Key Features
- Text-to-image generation guided by prompts
- Custom width and height from 256 to 2560 pixels
- Optional prompt rewriting, disabled by default
- Reproducible generation with
seed
Example Requests
Basic
{
"prompt": "A cinematic portrait of an astronaut standing in a field of wildflowers"
}
Custom Size with Prompt Rewriting
{
"prompt": "A futuristic city at sunset",
"width": 1536,
"height": 1024,
"seed": 42,
"prompt_extend": true
}
Pricing
| Item | Price (USD) |
|---|---|
| Image generation | $0.02 / image |
Parameters
prompt
- Type: string, required
- Text prompt used to guide image generation
width / height
- Range: 256–2560 pixels each
- Default: 1024 × 1024
seed
- Type: integer or null
- Range: 0–2147483647
- Default:
0(random)
prompt_extend
- Type: boolean or null
- Default:
false - When
true, the prompt is rewritten and expanded before image generation;nulluses the default
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Text prompt used to guide image generation.
Minimum string length:
1Output image width in pixels.
Required range:
256 <= x <= 2560Output image height in pixels.
Required range:
256 <= x <= 2560Random seed. Set to 0 or null to generate a random seed.
Required range:
0 <= x <= 2147483647Whether to rewrite and expand the prompt before image generation. null uses the default.
Response
Accepted - Task created successfully
Show child attributes
Show child attributes

