---
title: &quot;Use Grok Imagine in OpenClaw via RunAPI — Image &amp; Video API Guide&quot;
url: &quot;https://runapi.ai/openclaw-grok-imagine.md&quot;
canonical: &quot;https://runapi.ai/openclaw-grok-imagine&quot;
locale: &quot;en&quot;
model: &quot;grok-imagine&quot;
---

# Use Grok Imagine in OpenClaw.

Grok Imagine is xAI&#39;s image and video generation suite — text-to-image, image-to-image, text-to-video, and image-to-video. OpenClaw agents call it through the same RunAPI key and /v1 endpoint used for chat, with no extra skills to install.

## 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;grok-imagine-text-to-image&quot;,
    &quot;prompt&quot;: &quot;a robot hand placing a chess piece on a board, dramatic side lighting, slow motion feel&quot;
  }&#39;

```

### Response

```json
{
  &quot;task_id&quot;: &quot;tsk_abc123&quot;,
  &quot;status&quot;: &quot;pending&quot;,
  &quot;model&quot;: &quot;grok-imagine-text-to-image&quot;
}

```

## How it works

1. **Configure RunAPI** — Set the RUNAPI_API_KEY environment variable in your shell profile. If RunAPI is already configured in OpenClaw for chat, the same key works for Grok Imagine — no additional setup needed.
2. **Call Grok Imagine** — Send a POST request to the text_to_image endpoint with the model set to grok-imagine-text-to-image. Include your prompt describing the image. For video, use text_to_video with grok-imagine-text-to-video.
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 output image or video URL from the response.

## Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `model` | `string` | Required. E.g. grok-imagine-text-to-image, grok-imagine-image-to-video. |
| `prompt` | `string` | Text description of the desired output. |
| `image_url` | `string` | Source image URL for image-to-image or image-to-video. |
| `aspect_ratio` | `string` | Optional. Output aspect ratio, e.g. 16:9, 1:1. |

## FAQ

### Can I use Grok Imagine in OpenClaw?

Yes. If RunAPI is already configured as an OpenAI-compatible provider in OpenClaw, the same API key and /v1 endpoint work for Grok Imagine. Set the model to grok-imagine-text-to-image and call the text_to_image endpoint.

### Is Grok Imagine still free, or do I need a paid plan?

Through RunAPI, Grok Imagine uses pay-per-task billing -- no Grok subscription or SuperGrok plan required. You pay only for completed generations from your RunAPI credit balance. Check the RunAPI pricing page for current rates.

### Can Grok Imagine generate videos with audio?

Yes. Grok Imagine supports text-to-video generation with synchronized audio. Use the text_to_video endpoint with the grok-imagine-text-to-video model. The output includes both video and matching audio in a single file.

### How does Grok Imagine compare to Midjourney and DALL-E for photorealistic images?

Grok Imagine produces strong photorealistic results, especially for portraits and character generation. It also supports video output, which Midjourney and DALL-E do not. Quality varies by prompt -- test with your specific use case to compare.


## Links

- [OpenClaw setup guide →](https://runapi.ai/openclaw)
- [Grok Imagine models →](https://runapi.ai/models/grok-imagine)
- [Model catalog](https://runapi.ai/models)
- [API docs](https://runapi.ai/docs)
