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

> 使用 Z-Image 模型生成图片



## OpenAPI

````yaml /zh/api-reference/image/openapi.json post /v1/images/zimage
openapi: 3.0.3
info:
  title: 图片服务 API
  description: AI图片生成服务 API - 提供多种AI模型图片生成、任务查询和历史记录功能
  version: 1.0.0
  contact:
    name: API Support
servers:
  - url: https://api.tensorslab.com
    description: 开发环境
security: []
tags:
  - name: 图片生成
    description: 图片生成相关接口
  - name: 任务管理
    description: 任务管理相关接口
paths:
  /v1/images/zimage:
    post:
      tags:
        - 图片生成
      summary: Z-Image
      description: 使用 Z-Image 模型生成图片
      operationId: zImage
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  description: 提示词（必填）
                resolution:
                  type: string
                  description: 图片分辨率：9:16、16:9、1:1、3:4、4:3 或 WxH
                  default: 1024*1024
                seed:
                  type: integer
                  description: 随机种子
                prompt_extend:
                  type: string
                  description: 是否扩展提示词内容，1 为启用
                  enum:
                    - '0'
                    - '1'
      responses:
        '200':
          description: 请求成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GeneralResponse:
      type: object
      description: 通用响应
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/GeneralData'
          required:
            - data
    BaseResponse:
      type: object
      description: 基础响应结构
      properties:
        code:
          type: integer
          description: 响应状态码：1000=成功，9999=失败，9000=积分不足
        msg:
          type: string
          description: 响应消息
      required:
        - code
        - msg
    GeneralData:
      type: object
      description: 通用数据响应
      properties:
        taskid:
          type: string
          description: 任务ID，用于后续查询任务状态
        url:
          type: string
          description: 生成的图片URL（某些接口返回）
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API密钥认证，请在请求头中包含Authorization字段

````