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

# Z-Image Turbo

> Text-to-image generation and single-image editing with Z-Image Turbo

<Tip>
  1. After submission, use the returned `task_id` to retrieve the result through [Query Task Status](/api-manual/task-management/status).
  2. Provide `callback_url` to receive a POST notification when the task reaches `finished` or `failed`.
</Tip>

## Model

`alibaba/z-image/turbo` generates images from text and edits a single reference image.

## Input parameters

* `prompt`: Required string containing 1 to 1000 characters. Describe the image to generate or the edits to apply.
* `image_urls`: Optional array containing exactly one HTTP(S) image URL. Providing this field selects image editing.
* `size`: Required for text-to-image and optional for image editing. Values: `1:1`, `4:3`, `3:4`, `16:9`, `9:16`.
* `enable_safety_checker`: Optional boolean. Defaults to `true`.

## Text to image

```json theme={null}
{
  "model": "alibaba/z-image/turbo",
  "input": {
    "prompt": "A ceramic vase on a wooden table in soft daylight.",
    "size": "1:1",
    "enable_safety_checker": true
  }
}
```

## Image editing

```json theme={null}
{
  "model": "alibaba/z-image/turbo",
  "input": {
    "prompt": "Add soft studio lighting to this product photo.",
    "image_urls": ["https://example.com/reference.png"],
    "enable_safety_checker": true
  }
}
```


## OpenAPI

````yaml api-manual/image-series/alibaba-z-image-turbo.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Z-Image Turbo
  description: Text-to-image generation and single-image editing with Z-Image Turbo.
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Z-Image Turbo
      summary: Submit Z-Image Turbo Task
      description: Generate an image from a prompt or edit one reference image.
      operationId: submitZImageTurboTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              text-to-image:
                summary: Text to image
                value:
                  model: alibaba/z-image/turbo
                  input:
                    prompt: A ceramic vase on a wooden table in soft daylight.
                    size: '1:1'
                    enable_safety_checker: true
              image-editing:
                summary: Image editing
                value:
                  model: alibaba/z-image/turbo
                  input:
                    prompt: Add soft studio lighting to this product photo.
                    image_urls:
                      - https://example.com/reference.png
                    enable_safety_checker: true
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: Invalid request parameters
        '401':
          description: Unauthorized
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
            - alibaba/z-image/turbo
          example: alibaba/z-image/turbo
          description: Z-Image Turbo model identifier.
        callback_url:
          type: string
          format: uri
          description: Optional webhook callback URL.
        input:
          type: object
          required:
            - prompt
          description: >-
            Image generation parameters. size is required for text-to-image and
            optional when image_urls supplies an editing reference.


            Provide at least one of `size`, `image_urls`.
          anyOf:
            - required:
                - size
            - required:
                - image_urls
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 1000
              description: >-
                Describe the image to generate or the edits to apply. Contains 1
                to 1000 characters.
              example: A ceramic vase on a wooden table in soft daylight.
            image_urls:
              type: array
              minItems: 1
              maxItems: 1
              items:
                type: string
                format: uri
                pattern: ^https?://
              description: >-
                One HTTP(S) image URL used as the editing reference. Providing
                this field selects image editing.
              example:
                - https://example.com/reference.png
            size:
              type: string
              enum:
                - '1:1'
                - '4:3'
                - '3:4'
                - '16:9'
                - '9:16'
              description: >-
                Output aspect ratio. Required for text-to-image; optional for
                image editing.
              example: '1:1'
            enable_safety_checker:
              type: boolean
              default: true
              description: Enable the safety checker. Defaults to true.
              example: true
          additionalProperties: false
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
            status:
              type: string
              enum:
                - not_started
                - running
                - failed
            created_time:
              type: string
              format: date-time
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use `Authorization: Bearer VIDGO_API_KEY`.'

````