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

# Use Imagen 4 in Hermes Agent.

Imagen 4 is Google DeepMind&#39;s image generation model with accurate text rendering and high prompt fidelity. Hermes Agent calls it through the same RunAPI custom provider endpoint you use for chat — no ComfyUI or GPU setup 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;imagen-4&quot;,
    &quot;prompt&quot;: &quot;A ceramic coffee mug on a wooden table with morning light, the text HELLO printed on the side in serif font, photorealistic&quot;
  }&#39;

```

### Response

```json
{
  &quot;task_id&quot;: &quot;tsk_abc123&quot;,
  &quot;status&quot;: &quot;pending&quot;,
  &quot;model&quot;: &quot;imagen-4&quot;
}

```

## How it works

1. **Configure RunAPI** — Set the RUNAPI_API_KEY environment variable. If you already configured RunAPI as a custom:runapi provider in Hermes Agent for chat, the same key and base_url work for image generation.
2. **Call Imagen 4** — Send a POST request to the text_to_image endpoint with model set to imagen-4. Include a descriptive prompt. Add aspect_ratio or negative_prompt as needed.
3. **Get the result** — The response includes a task_id. Poll the task status endpoint until status changes to completed. The finished response contains the generated image URL.

## Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `model` | `string` | Required. imagen-4, imagen-4-fast, or imagen-4-ultra. |
| `prompt` | `string` | Text description of the desired image. |
| `aspect_ratio` | `string` | Optional. E.g. 1:1, 16:9, 9:16. |
| `negative_prompt` | `string` | Optional. What to avoid in the generated image. |

## FAQ

### Can I use Imagen 4 in Hermes Agent?

Yes. Hermes Agent calls Imagen 4 through the RunAPI text_to_image endpoint. Set the model field to imagen-4 and send the request with the same RUNAPI_API_KEY you configured for the custom:runapi provider. No ComfyUI or GPU rental required.

### Do I need a separate API key for Imagen 4?

No. The same RUNAPI_API_KEY works for all 113+ models across chat, image, video, and music. One key, one billing account.

### When should I use Fast vs Standard vs Ultra?

Fast is for draft iterations and concept exploration where speed and cost matter more than detail. Standard is the default for production work. Ultra produces the highest-detail output for hero images or print-quality assets. All three use the same prompt format -- just change the model slug.

### How strict are the content filters?

Imagen 4 has relatively strict content filters that can sometimes flag innocuous prompts. If a generation is rejected, rephrase to be more explicit about the intended context. The filters are most sensitive around people and brand imagery.


## Links

- [Hermes Agent setup guide →](https://runapi.ai/hermes-agent)
- [Imagen 4 models →](https://runapi.ai/models/imagen-4)
- [Model catalog](https://runapi.ai/models)
- [API docs](https://runapi.ai/docs)
