> ## Documentation Index
> Fetch the complete documentation index at: https://mulerouter.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Z-Image Spicy Pro Text-To-Image Generation

> Generate an image from a text prompt using the Z-Image Spicy Pro model.

## 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

```json theme={null}
{
  "prompt": "A cinematic portrait of an astronaut standing in a field of wildflowers"
}
```

### Custom Size with Prompt Rewriting

```json theme={null}
{
  "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; `null` uses the default


## OpenAPI

````yaml api-reference/endpoint/carrothub/z-image-spicy-pro/z-image-spicy-pro.yaml POST /vendors/carrothub/v1/z-image-spicy-pro/generation
openapi: 3.1.0
info:
  title: Z-Image Spicy Pro Text-to-Image API
  description: Generate images from text prompts using the Z-Image Spicy Pro model.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.mulerouter.ai/
security:
  - bearerAuth: []
paths:
  /vendors/carrothub/v1/z-image-spicy-pro/generation:
    post:
      summary: Create Generation Task
      description: Generate an image from a text prompt using the Z-Image Spicy Pro model.
      operationId: z_image_spicy_pro_generation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ZImageSpicyProRequest'
      responses:
        '202':
          description: Accepted - Task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreatedResponse'
        '400':
          description: Bad Request - payload validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ZImageSpicyProRequest:
      type: object
      additionalProperties: false
      properties:
        prompt:
          type: string
          minLength: 1
          description: Text prompt used to guide image generation.
        width:
          type: integer
          description: Output image width in pixels.
          minimum: 256
          maximum: 2560
          default: 1024
        height:
          type: integer
          description: Output image height in pixels.
          minimum: 256
          maximum: 2560
          default: 1024
        seed:
          anyOf:
            - type: integer
              minimum: 0
              maximum: 2147483647
            - type: 'null'
          description: Random seed. Set to 0 or null to generate a random seed.
          default: 0
        prompt_extend:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Whether to rewrite and expand the prompt before image generation.
            null uses the default.
          default: false
      required:
        - prompt
    TaskCreatedResponse:
      type: object
      additionalProperties: true
      properties:
        task_info:
          $ref: '#/components/schemas/TaskInfoCreated'
    ErrorResponse:
      type: object
      additionalProperties: true
      properties:
        task_info:
          $ref: '#/components/schemas/TaskInfoErrorResponse'
    TaskInfoCreated:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: UUID of the task
          format: uuid
        status:
          type: string
          description: Task status (pending when created)
          enum:
            - pending
        created_at:
          type: string
          description: Task creation timestamp (ISO 8601)
          format: date-time
        updated_at:
          type: string
          description: Task last update timestamp (ISO 8601)
          format: date-time
      required:
        - id
        - status
        - created_at
        - updated_at
    TaskInfoErrorResponse:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: UUID of the task
          format: uuid
        status:
          type: string
          description: Task status (always failed for error responses)
          enum:
            - failed
        created_at:
          type: string
          description: Task creation timestamp (ISO 8601)
          format: date-time
        updated_at:
          type: string
          description: Task last update timestamp (ISO 8601)
          format: date-time
        error:
          $ref: '#/components/schemas/TaskInfoErrorObject'
      required:
        - id
        - status
        - created_at
        - updated_at
        - error
    TaskInfoErrorObject:
      type: object
      additionalProperties: true
      properties:
        code:
          type: integer
          description: Error code
          example: 3001
        title:
          type: string
          description: Error title
          example: Invalid Request
        detail:
          type: string
          description: Error detail
          example: Task execution failed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````