# Z-Image Turbo > Generates images quickly with clear Chinese and English text rendering and PNG output up to 2K. ## Overview - **Endpoint**: `https://api.higgsfield.ai/z-image/turbo` - **Model ID**: `z-image/turbo` - **Category**: text2image - **Kind**: inference - **Tags**: partners, commercial_use ## Pricing Public pricing information is not available for this model. ## Authentication Keep credentials in server-side environment variables. The SDKs accept the same `KEY_ID:KEY_SECRET` value under their documented variable names. ```bash export HF_CREDENTIALS="YOUR_KEY_ID:YOUR_KEY_SECRET" # TypeScript export HF_KEY="YOUR_KEY_ID:YOUR_KEY_SECRET" # Python and cURL ``` The official SDKs configure the authorization header. Keep credentials server-side; the TypeScript SDK blocks browser use. ## API Information Use `subscribe` to submit the model request and wait for a terminal result. TypeScript performs automatic polling with `withPolling: true`; Python's synchronous `subscribe` call also waits. ### Input Parameters - **`seed`** (`integer`, _optional_): Optional random seed for similar, reproducible results. - **`prompt`** (`string`, _required_): Positive prompt describing the desired content, style, and composition. - **`resolution`** (`string`, _optional_): Output resolution tier. Both tiers produce PNG images. - Default: `"1k"` - Options: `1k`, `2k` - **`aspect_ratio`** (`string`, _optional_): Output aspect ratio. Exact provider-recommended dimensions are selected automatically. - Default: `"1:1"` - Options: `1:1`, `2:3`, `3:2`, `3:4`, `4:3`, `7:9`, `9:7`, `9:16`, `16:9`, `21:9` - **`prompt_extend`** (`boolean`, _optional_): Rewrite and reason over the prompt before generation; this uses the enhanced price tier. - Default: `false` ### Input JSON Schema ```json { "type": "object", "title": "Z-Image Turbo", "required": [ "prompt" ], "properties": { "seed": { "type": "integer", "maximum": 2147483647, "minimum": 0, "description": "Optional random seed for similar, reproducible results." }, "prompt": { "type": "string", "maxLength": 800, "minLength": 1, "description": "Positive prompt describing the desired content, style, and composition." }, "resolution": { "enum": [ "1k", "2k" ], "type": "string", "default": "1k", "description": "Output resolution tier. Both tiers produce PNG images." }, "aspect_ratio": { "enum": [ "1:1", "2:3", "3:2", "3:4", "4:3", "7:9", "9:7", "9:16", "16:9", "21:9" ], "type": "string", "default": "1:1", "description": "Output aspect ratio. Exact provider-recommended dimensions are selected automatically." }, "prompt_extend": { "type": "boolean", "default": false, "description": "Rewrite and reason over the prompt before generation; this uses the enhanced price tier." } }, "additionalProperties": false } ``` ### Required Parameters Example ```json { "prompt": "A cinematic scene at sunset", "resolution": "1k", "aspect_ratio": "1:1", "prompt_extend": false } ``` ### Output Schema The shared polling endpoint returns one of the following status shapes: ```json { "title": "RequestStatus", "oneOf": [ { "title": "PendingRequestStatus", "type": "object", "properties": { "request_id": { "type": "string", "format": "uuid" }, "status_url": { "type": "string", "format": "uri" }, "cancel_url": { "type": "string", "format": "uri" }, "status": { "type": "string", "enum": [ "queued", "in_progress", "nsfw", "canceled" ] } }, "required": [ "status", "request_id" ] }, { "title": "FailedRequestStatus", "type": "object", "properties": { "request_id": { "type": "string", "format": "uuid" }, "status_url": { "type": "string", "format": "uri" }, "cancel_url": { "type": "string", "format": "uri" }, "status": { "type": "string", "const": "failed" }, "error": { "type": "string" } }, "required": [ "status", "request_id", "error" ] }, { "title": "CompletedRequestStatus", "type": "object", "properties": { "request_id": { "type": "string", "format": "uuid" }, "status_url": { "type": "string", "format": "uri" }, "cancel_url": { "type": "string", "format": "uri" }, "status": { "type": "string", "const": "completed" }, "images": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string", "format": "uri" } }, "required": [ "url" ] } } }, "required": [ "status", "request_id", "images" ] } ] } ``` ## SDK Installation Install one of the official server-side SDKs: ```bash npm install @higgsfield/client # or pip install higgsfield-client ``` ## Usage Examples ### TypeScript ```typescript import { config, higgsfield } from "@higgsfield/client/v2"; config({ credentials: process.env.HF_CREDENTIALS, }); const result = await higgsfield.subscribe( "z-image/turbo", { input: { "prompt": "A cinematic scene at sunset", "resolution": "1k", "aspect_ratio": "1:1", "prompt_extend": false }, withPolling: true, }, ); console.log(result); ``` ### Python ```python import higgsfield_client result = higgsfield_client.subscribe( 'z-image/turbo', arguments={'prompt': 'A cinematic scene at sunset', 'resolution': '1k', 'aspect_ratio': '1:1', 'prompt_extend': False}, ) print(result) ``` ### cURL ```bash curl --request POST \ --url 'https://api.higgsfield.ai/z-image/turbo' \ --header "Authorization: Key $HF_KEY" \ --header "Content-Type: application/json" \ --data @- <<'JSON' { "prompt": "A cinematic scene at sunset", "resolution": "1k", "aspect_ratio": "1:1", "prompt_extend": false } JSON ``` ## Additional Documentation # About **Z-Image Turbo** uses the model ID `z-image/turbo`. Fast text-to-image generation with strong Chinese and English text rendering. ## 1. Calling the API Send requests to `https://api.higgsfield.ai/z-image/turbo` with a JSON body matching the parameters below. ### Install Install an official server-side SDK. cURL needs no package. ```bash control=package group=install-typescript variant=npm label=npm when=javascript npm install @higgsfield/client ``` ```bash control=package group=install-python variant=pip label=pip when=python pip install higgsfield-client ``` ### Setup Keep credentials in server-side environment variables. The SDKs accept the same `KEY_ID:KEY_SECRET` value under their documented variable names. ```bash export HF_CREDENTIALS="YOUR_KEY_ID:YOUR_KEY_SECRET" # TypeScript export HF_KEY="YOUR_KEY_ID:YOUR_KEY_SECRET" # Python and cURL ``` ### Request parameters | Parameter | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `seed` | `integer` | No | `—` | Optional random seed for similar, reproducible results. Minimum: 0. Maximum: 2147483647. | | `prompt` | `string` | Yes | `—` | Positive prompt describing the desired content, style, and composition. Minimum length: 1. Maximum length: 800. | | `resolution` | `string` | No | `"1k"` | Output resolution tier. Both tiers produce PNG images. Options: 1k, 2k. | | `aspect_ratio` | `string` | No | `"1:1"` | Output aspect ratio. Exact provider-recommended dimensions are selected automatically. Options: 1:1, 2:3, 3:2, 3:4, 4:3, 7:9, 9:7, 9:16, 16:9, 21:9. | | `prompt_extend` | `boolean` | No | `false` | Rewrite and reason over the prompt before generation; this uses the enhanced price tier. | ## 2. Authentication The official SDKs read credentials from the server environment and send the required `Authorization: Key KEY_ID:KEY_SECRET` header. ### API Key Never expose the secret in browser-side code or commit it to source control. The TypeScript SDK is server-side only. For direct HTTP calls, use: ```http Authorization: Key $HF_KEY ``` ## 3. Queue `subscribe` submits the asynchronous request and waits for a terminal result. The TypeScript SDK polls automatically when `withPolling: true`; the Python SDK's synchronous `subscribe` call also waits. A completed request returns generated files in the `images` array. ### Submit and wait ```ts control=language group=submit variant=javascript label=TypeScript import { config, higgsfield } from "@higgsfield/client/v2"; config({ credentials: process.env.HF_CREDENTIALS, }); const result = await higgsfield.subscribe( "z-image/turbo", { input: { "prompt": "A cinematic scene at sunset", "resolution": "1k", "aspect_ratio": "1:1", "prompt_extend": false }, withPolling: true, }, ); console.log(result); ``` ```python control=language group=submit variant=python label=Python import higgsfield_client result = higgsfield_client.subscribe( 'z-image/turbo', arguments={'prompt': 'A cinematic scene at sunset', 'resolution': '1k', 'aspect_ratio': '1:1', 'prompt_extend': False}, ) print(result) ``` ```bash control=language group=submit variant=curl label=cURL curl --request POST \ --url 'https://api.higgsfield.ai/z-image/turbo' \ --header "Authorization: Key $HF_KEY" \ --header "Content-Type: application/json" \ --data @- <<'JSON' { "prompt": "A cinematic scene at sunset", "resolution": "1k", "aspect_ratio": "1:1", "prompt_extend": false } JSON ``` ### Explicit lifecycle control Use the Python SDK when a worker needs explicit status, result, or cancellation control for an existing request. The TypeScript v2 client currently exposes automatic polling through `subscribe`. ```python import higgsfield_client request_id = "{request_id}" status = higgsfield_client.status(request_id=request_id) result = higgsfield_client.result(request_id=request_id) higgsfield_client.cancel(request_id=request_id) ``` ## Additional Resources - [Model page](https://console.higgsfield.ai/models/z-image/turbo) - [This LLM-readable document](https://dash.higgsfield.ai/models/z-image/turbo/llms.txt)