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

# Z-Image

> Generate images using Z-Image model



## OpenAPI

````yaml /api-reference/image/openapi.json post /v1/images/zimage
openapi: 3.0.3
info:
  title: Images Service API
  description: >-
    AI Image Generation Service API - Provides various AI model image
    generation, task query and history record functions
  version: 1.0.0
  contact:
    name: API Support
servers:
  - url: https://api.tensorslab.com
    description: Development environment
security: []
tags:
  - name: Image Generation
    description: Image generation related interfaces
  - name: Task Management
    description: Task management related interfaces
paths:
  /v1/images/zimage:
    post:
      tags:
        - Image Generation
      summary: Z-Image
      description: Generate images using Z-Image model
      operationId: zImage
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: Prompt (required)
                resolution:
                  type: string
                  description: 'Image resolution: 9:16, 16:9, 1:1, 3:4, 4:3 or WxH'
                  default: 1024*1024
                seed:
                  type: integer
                  description: Random seed
                prompt_extend:
                  type: string
                  description: Extend prompt content, 1 for enabled
                  enum:
                    - '0'
                    - '1'
      responses:
        '200':
          description: Request successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GeneralResponse:
      type: object
      description: General response
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/GeneralData'
          required:
            - data
    BaseResponse:
      type: object
      description: Base response structure
      properties:
        code:
          type: integer
          description: >-
            Response status code: 1000=Success, 9999=Failure, 9000=Insufficient
            Credits
        msg:
          type: string
          description: Response message
      required:
        - code
        - msg
    GeneralData:
      type: object
      description: General data response
      properties:
        taskid:
          type: string
          description: Task ID, used for subsequent task status query
        url:
          type: string
          description: Generated image URL (returned by some interfaces)
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API Key authentication, please include the Authorization field in the
        request header

````