---
title: &quot;透過 RunAPI 在 OpenClaw 中使用 Z Image — 圖像 API 指南&quot;
url: &quot;https://runapi.ai/zh-HK/openclaw-z-image.md&quot;
canonical: &quot;https://runapi.ai/zh-HK/openclaw-z-image&quot;
locale: &quot;zh-HK&quot;
model: &quot;z-image&quot;
---

# 在 OpenClaw 中使用 Z Image。

Z Image 是 Alibaba 的快速圖像生成模型，具備中英文雙語文字渲染能力。OpenClaw agent 透過與聊天相同的 RunAPI 端點和 API key 呼叫它——無需額外 skills 或 provider 帳戶。

## API example

```bash
curl -X POST https://runapi.ai/v1/text_to_image \
  -H &quot;Authorization: Bearer $RUNAPI_API_KEY&quot; \
  -H &quot;Content-Type: application/json&quot; \
  -d &#39;{
    &quot;model&quot;: &quot;z-image&quot;,
    &quot;prompt&quot;: &quot;A neon-lit Tokyo street at night with Japanese shop signs, cinematic lighting, 8K detail&quot;
  }&#39;

```

### Response

```json
{
  &quot;task_id&quot;: &quot;tsk_abc123&quot;,
  &quot;status&quot;: &quot;pending&quot;,
  &quot;model&quot;: &quot;z-image&quot;
}

```

## How it works

1. **設定 RunAPI** — 將 RunAPI API key 設定為環境變數。如果你已在 OpenClaw 中為聊天設定了 RunAPI，同一個 key 亦適用於圖像生成。
2. **呼叫 Z Image** — 向 text_to_image 端點發送 POST 請求，將 model 設為 z-image，並附上文字 prompt。Z Image 支援中文和英文 prompt，文字渲染準確。
3. **取得結果** — API 立即返回 task_id。輪詢 task status 端點直到狀態變為 completed，然後從回應輸出中取得生成的圖像 URL。

## Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `model` | `string` | 必填。使用 z-image。 |
| `prompt` | `string` | 文字描述。支援中文和英文。 |
| `negative_prompt` | `string` | 可選。在圖像中需要避免的內容。 |
| `size` | `string` | 可選。輸出尺寸，例如 1024x1024。 |

## FAQ

### 我可以在 OpenClaw 中使用 Z Image 嗎？

可以。如果你已在 OpenClaw 中將 RunAPI 設定為 provider，同一個 API key 和端點亦可處理 Z Image 請求。向 text_to_image 端點發送 POST 請求，將 model 設為 z-image 即可。

### 使用 Z Image 需要獨立的 API key 嗎？

不需要。用於聊天和其他模型的同一個 RUNAPI_API_KEY 亦適用於 Z Image。所有 RunAPI 模型共用一個 key 和一個點數餘額。

### Z Image 是非同步還是同步？

Z Image 是非同步的。API 立即返回 task_id。輪詢 task status 端點或使用 webhook callback 以知悉圖像何時就緒。RunAPI SDK 會自動處理輪詢。

### Z Image 的收費是多少？

Z Image 按用量付費，按任務計費。請查看 RunAPI 收費頁面了解最新價格。無月費訂閱或最低消費。


## Links

- [OpenClaw 設定指南 →](https://runapi.ai/zh-HK/openclaw)
- [Z Image 模型 →](https://runapi.ai/zh-HK/models/z-image)
- [Model catalog](https://runapi.ai/zh-HK/models)
- [API docs](https://runapi.ai/zh-HK/docs)
