---
title: &quot;Use Z Image in Hermes Agent via RunAPI — Image API Guide&quot;
url: &quot;https://runapi.ai/hermes-z-image.md&quot;
canonical: &quot;https://runapi.ai/hermes-z-image&quot;
locale: &quot;en&quot;
model: &quot;z-image&quot;
---

# Use Z Image in Hermes Agent.

Z Image is Alibaba&#39;s fast image generation model with bilingual text rendering in Chinese and English. Hermes Agent calls it through the RunAPI custom provider endpoint — the same base_url and API key you use for chat, no extra plugins or GPU rentals needed.

## 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. **Configure RunAPI** — Set your RunAPI API key as an environment variable. If you already configured RunAPI as a custom provider in Hermes Agent, the same key and base_url work for image generation.
2. **Call Z Image** — Send a POST request to the text_to_image endpoint with model set to z-image and a text prompt. Z Image supports both Chinese and English prompts with accurate text rendering.
3. **Get the result** — The API returns a task_id immediately. Poll the task status endpoint until the status changes to completed, then retrieve the generated image URL from the response output.

## Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `model` | `string` | Required. Use z-image. |
| `prompt` | `string` | Text description. Supports Chinese and English. |
| `negative_prompt` | `string` | Optional. What to avoid in the image. |
| `size` | `string` | Optional. Output dimensions, e.g. 1024x1024. |

## FAQ

### Can I use Z Image in Hermes Agent?

Yes. If you have RunAPI configured as a custom provider in Hermes Agent, the same API key and base_url handle Z Image requests. Send a POST to the text_to_image endpoint with model set to z-image.

### Do I need a separate API key for Z Image?

No. The same RUNAPI_API_KEY you use for chat and other models also works for Z Image. All RunAPI models share one key and one credits balance.

### How does Z Image compare to Flux or Nano Banana?

Z Image wins on speed and cost -- sub-second generation at $0.004 per image. Flux 2 and Nano Banana produce higher-fidelity output but cost 5-10x more per image and take longer. Use Z Image for volume work and concept exploration, then switch to Flux 2 or Nano Banana for final production-quality selects.

### Does Z Image support custom LoRA adapters?

The open-source weights support LoRA fine-tuning for local deployment. Through the RunAPI endpoint, you use the base model without custom adapters. If you need fine-tuned output, run Z Image locally with your LoRA weights or use a model that supports style references like Ideogram V3.


## Links

- [Hermes Agent setup guide →](https://runapi.ai/hermes-agent)
- [Z Image models →](https://runapi.ai/models/z-image)
- [Model catalog](https://runapi.ai/models)
- [API docs](https://runapi.ai/docs)
