OPENCLAW + GROK IMAGINE

Use Grok Imagine in OpenClaw.

Grok Imagine is xAI'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.

one API key · text to image endpoint · async task polling
Use RunAPI to generate an image with xAI Grok Imagine.

Requirements:
- Use the RunAPI API at https://runapi.ai/v1/text_to_image.
- Read the API key from RUNAPI_API_KEY environment variable.
- Set the model to "grok-imagine-text-to-image".
- Write a descriptive prompt for the image you want.
- The response returns a task_id. Poll the task status endpoint until the task completes, then retrieve the output URL.
curl -X POST https://runapi.ai/v1/text_to_image \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-imagine-text-to-image",
    "prompt": "a robot hand placing a chess piece on a board, dramatic side lighting, slow motion feel"
  }'
{
  "task_id": "tsk_abc123",
  "status": "pending",
  "model": "grok-imagine-text-to-image"
}
Copy the curl command to test grok-imagine
HOW IT WORKS

Use Grok Imagine in OpenClaw in three steps

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.

export RUNAPI_API_KEY=runapi_xxx
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.

text_to_image
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.

task_id: tsk_abc123
PARAMETERS

Grok Imagine API 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.

What is Grok Imagine on OpenClaw?

Grok Imagine (Aurora) is xAI's image and video generator built into the Grok platform. It produces photorealistic portraits, anime-style illustrations, and short video clips with synchronized audio from text prompts. OpenClaw agents call it through RunAPI for text-to-image, image editing, and video generation without needing a Grok or SuperGrok subscription.

Grok Imagine use cases

Photorealistic portrait generation

Generate high-quality realistic portraits and character images from text descriptions, useful for social media profiles, marketing personas, or creative projects.

Social media content creation

Produce images and short video clips for social posts, stories, and ads directly from text prompts, with no watermark on outputs.

Stylized artwork and anime characters

Create illustration-style and anime character art from detailed prompts, generating consistent character designs for games, branding, or content series.

FAQ

Grok Imagine + OpenClaw questions

OpenClaw general setup

Not configured yet? Start with the RunAPI setup guide for OpenClaw.

OpenClaw setup guide →

Grok Imagine model catalog

See all Grok Imagine variants, pricing, and API docs.

Grok Imagine models →

Try Grok Imagine in OpenClaw today.

Get a free RunAPI key, paste the prompt into OpenClaw, and start generating images and video with xAI Grok Imagine.