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

# Z-Image Turbo Image Generation

> - Asynchronous processing mode, returns a task ID for subsequent queries
- Alibaba Tongyi high-speed text-to-image model, generates images in about 8 sampling steps, focused on realistic texture
- Clear rendering of Chinese and English text, suitable for posters, banners, and social media assets with titles
- Supports 9 image aspect ratios and returns 1 image per request
- Only supports text-to-image generation; reference images, image editing, and custom pixel dimensions are not supported
- Submitted prompts undergo platform sensitive-word / safety review, and violating content will be rejected outright


export const apiKeyUrl = 'https://aireiter.com/keys';

## Authorizations

<ParamField header="Authorization" type="string" required>
  All endpoints require Bearer Token authentication.

  Get the API Key:

  Visit <a href={apiKeyUrl} target="_blank">API Key management page</a> to get your API Key.

  Add the following to the request headers when using it:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Body

<ParamField body="model" type="string" required>
  Model name.

  Fixed value: `"z_image_turbo"`
</ParamField>

<ParamField body="params" type="object" required>
  Model parameter object.

  <Expandable title="params Object Properties">
    <ParamField body="prompt" type="string" required>
      Image generation prompt, up to 2000 characters.

      * Supports both Chinese and English. It is recommended to clearly describe the subject, scene, composition, lighting, and materials
      * The model leans toward a realistic style, so prompts that describe real lighting and materials work better
      * If text needs to appear in the image, wrap the text in quotation marks. Chinese and English are both supported
      * Before submission, it will go through the platform's sensitive-word / safety review. If prohibited content is detected, an error will be returned directly
    </ParamField>

    <ParamField body="aspect_ratio" type="string" default="1:1">
      Image aspect ratio.

      Supported values:

      * `1:1` - Square (default)
      * `16:9` / `9:16` - Widescreen landscape / portrait
      * `4:3` / `3:4` - Standard landscape / portrait
      * `3:2` / `2:3` - Classic landscape / portrait
      * `2:1` / `1:2` - Panoramic landscape / tall portrait

      <Warning>
        `aspect_ratio` indicates the model's target aspect-ratio bucket and does not guarantee a fixed pixel size. The returned image uses the model's native size closest to that ratio. For example, a measured 16:9 returns 1536×864.
      </Warning>
    </ParamField>

    <ParamField body="seed" type="integer">
      Random seed, used to reproduce results, range 1-2147483647.

      * The same `prompt` + `seed` combination will generate images with a similar composition
      * If not provided, each generation will be random
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="out_task_id" type="string" required>
  Caller-defined task ID, used for idempotent submission and result queries.

  * Length: 1-64 characters
  * Only letters, numbers, underscores, and hyphens are allowed
  * Cannot be reused under the same API Key
</ParamField>

<Note>
  Z-Image Turbo only supports text-to-image. Reference images (`image_url`), image editing, resolution tiers (`resolution`), and batch image generation (`output_n`) are not supported; passing a custom pixel size `size` will directly return `Model "z_image_turbo" does not support size parameter`. Each request returns exactly 1 image. If you need multiple images, please submit multiple times with different `seed` values.

  If you need reference images, image-to-image, or a larger canvas, please use GPT-Image 2, Seedream 5.0 Pro, or Nano Banana Pro instead.
</Note>

## Response

<ResponseField name="out_task_id" type="string">
  The caller's task ID, which can be used to query the result.
</ResponseField>

<ResponseField name="status" type="string">
  Initial status, fixed as `"pending"`.
</ResponseField>

<ResponseField name="estimated_credits" type="number">
  Estimated credit usage for this task.
</ResponseField>

<ResponseField name="created_at" type="string">
  Creation time, in ISO 8601 format.
</ResponseField>

## Query Results

After submission succeeds, call with the same `out_task_id`:

```bash theme={null}
curl --request POST \
  --url https://aireiter.com/api/openapi/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "out_task_id": "z_image_turbo_task_001"
  }'
```

Task statuses include `pending`, `processing`, `completed`, and `failed`. After the task is completed, the output image is located in `data.output`, and the actual credits used are in `data.credits_used`. If task generation fails, the system will automatically refund the pre-deducted credits for this task.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://aireiter.com/api/openapi/submit \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "z_image_turbo",
      "params": {
        "prompt": "A ceramic coffee cup on a marble countertop in morning side light, shallow depth of field, realistic materials and natural shadows, commercial product photography",
        "aspect_ratio": "16:9"
      },
      "out_task_id": "z_image_turbo_task_001"
    }'
  ```

  ```bash cURL (Fixed seed reproduction) theme={null}
  curl --request POST \
    --url https://aireiter.com/api/openapi/submit \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "z_image_turbo",
      "params": {
        "prompt": "A skincare poster with a bottle on a dark background, the front of the bottle says \"New Arrivals\", cool rim lighting, realistic glass reflections",
        "aspect_ratio": "9:16",
        "seed": 20260827
      },
      "out_task_id": "z_image_turbo_seed_001"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://aireiter.com/api/openapi/submit"

  payload = {
      "model": "z_image_turbo",
      "params": {
          "prompt": "A ceramic coffee cup on a marble countertop in morning side light, shallow depth of field, realistic materials and natural shadows, commercial product photography",
          "aspect_ratio": "16:9"
      },
      "out_task_id": "z_image_turbo_python_001"
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://aireiter.com/api/openapi/submit", {
    method: "POST",
    headers: {
      Authorization: "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      model: "z_image_turbo",
      params: {
        prompt: "A ceramic coffee cup on a marble countertop in morning side light, shallow depth of field, realistic materials and natural shadows, commercial product photography",
        aspect_ratio: "16:9"
      },
      out_task_id: "z_image_turbo_javascript_001"
    })
  });

  console.log(await response.json());
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "fmt"
      "io"
      "net/http"
  )

  func main() {
      payload := []byte(`{
        "model":"z_image_turbo",
        "params":{
          "prompt":"A ceramic coffee cup on a marble countertop in morning side light, shallow depth of field, realistic materials and natural shadows, commercial product photography",
          "aspect_ratio":"16:9"
        },
        "out_task_id":"z_image_turbo_go_001"
      }`)

      req, _ := http.NewRequest(
          http.MethodPost,
          "https://aireiter.com/api/openapi/submit",
          bytes.NewBuffer(payload),
      )
      req.Header.Set("Authorization", "Bearer <token>")
      req.Header.Set("Content-Type", "application/json")

      response, err := http.DefaultClient.Do(req)
      if err != nil {
          panic(err)
      }
      defer response.Body.Close()

      body, _ := io.ReadAll(response.Body)
      fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  public class Main {
      public static void main(String[] args) throws Exception {
          String payload = """
          {
            "model": "z_image_turbo",
            "params": {
              "prompt": "A ceramic coffee cup on a marble countertop in morning side light, shallow depth of field, realistic materials and natural shadows, commercial product photography",
              "aspect_ratio": "16:9"
            },
            "out_task_id": "z_image_turbo_java_001"
          }
          """;

          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create("https://aireiter.com/api/openapi/submit"))
              .header("Authorization", "Bearer <token>")
              .header("Content-Type", "application/json")
              .POST(HttpRequest.BodyPublishers.ofString(payload))
              .build();

          HttpResponse<String> response = HttpClient.newHttpClient().send(
              request,
              HttpResponse.BodyHandlers.ofString()
          );
          System.out.println(response.body());
      }
  }
  ```

  ```php PHP theme={null}
  <?php

  $url = "https://aireiter.com/api/openapi/submit";

  $payload = [
      "model" => "z_image_turbo",
      "params" => [
          "prompt" => "A ceramic coffee cup on a marble countertop in morning side light, shallow depth of field, realistic materials and natural shadows, commercial product photography",
          "aspect_ratio" => "16:9"
      ],
      "out_task_id" => "z_image_turbo_php_001"
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload, JSON_UNESCAPED_UNICODE));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer <token>",
      "Content-Type: application/json"
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ?>
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  url = URI("https://aireiter.com/api/openapi/submit")

  payload = {
    model: "z_image_turbo",
    params: {
      prompt: "A ceramic coffee cup on a marble countertop in morning side light, shallow depth of field, realistic materials and natural shadows, commercial product photography",
      aspect_ratio: "16:9"
    },
    out_task_id: "z_image_turbo_ruby_001"
  }

  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 = payload.to_json

  response = http.request(request)
  puts response.body
  ```

  ```dart Dart theme={null}
  import 'dart:convert';
  import 'package:http/http.dart' as http;

  void main() async {
    final url = Uri.parse('https://aireiter.com/api/openapi/submit');

    final payload = {
      "model": "z_image_turbo",
      "params": {
        "prompt": "A ceramic coffee cup on a marble countertop in morning side light, shallow depth of field, realistic materials and natural shadows, commercial product photography",
        "aspect_ratio": "16:9"
      },
      "out_task_id": "z_image_turbo_dart_001"
    };

    final response = await http.post(
      url,
      headers: {
        'Authorization': 'Bearer <token>',
        'Content-Type': 'application/json'
      },
      body: jsonEncode(payload),
    );

    print(response.body);
  }
  ```

  ```r R theme={null}
  library(httr)
  library(jsonlite)

  url <- "https://aireiter.com/api/openapi/submit"

  payload <- list(
    model = "z_image_turbo",
    params = list(
      prompt = "A ceramic coffee cup on a marble countertop in morning side light, shallow depth of field, realistic materials and natural shadows, commercial product photography",
      aspect_ratio = "16:9"
    ),
    out_task_id = "z_image_turbo_task_001"
  )

  response <- POST(
    url,
    add_headers(
      Authorization = "Bearer <token>",
      `Content-Type` = "application/json"
    ),
    body = toJSON(payload, auto_unbox = TRUE),
    encode = "raw"
  )

  cat(content(response, "text"))
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "statusCode": 200,
    "message": "",
    "data": {
      "task_id": "",
      "status": "pending",
      "created_at": "2026-08-27T09:47:44.021Z",
      "out_task_id": "z_image_turbo_task_001",
      "estimated_credits": "<Estimated Credits>"
    },
    "ok": true
  }
  ```

  ```json 400 theme={null}
  {
    "statusCode": 400,
    "message": "Invalid aspect_ratio: \"21:9\". Allowed: [1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 2:1, 1:2]",
    "ok": false
  }
  ```

  ```json 400 theme={null}
  {
    "statusCode": 400,
    "message": "Model \"z_image_turbo\" does not support size parameter",
    "ok": false
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "Authentication failed, please check your API key"
    }
  }
  ```

  ```json 433 theme={null}
  {
    "error": {
      "code": 433,
      "message": "Insufficient account balance, please top up and try again"
    }
  }
  ```

  ```json 500 theme={null}
  {
    "error": {
      "code": 500,
      "message": "Internal server error, please try again later"
    }
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.