Grok Image API for Openclaw

An OpenAI-compatible interface for automated image generation and editing via the Openclaw Skills framework.

xiaolozee
v1.1.1
Mar 8, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install grok-image-api

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install grok-image-api using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Grok Image API?

The Grok Image API skill provides a streamlined interface for interacting with image endpoints that follow the OpenAI standard. This skill is a core part of the Openclaw Skills ecosystem, allowing users to execute complex image tasks such as text-to-image generation and prompt-based image editing. It is designed to work with any provider exposing /v1/images/generations and /v1/images/edits, ensuring maximum flexibility for developers using various AI backends.

By prioritizing local file management, the skill ensures that generated assets are immediately available for further processing or delivery across communication channels. Whether you are building automated design pipelines or enhancing chat agent capabilities, this skill offers a reliable bridge between raw API calls and actionable local files.

Grok Image API Use Cases

  • Generating high-resolution images from text prompts for creative projects.
  • Editing existing images by providing replacement prompts and optional masks.
  • Verifying the health and response format of image-related AI endpoints.
  • Delivering AI-generated visuals directly to messaging platforms like QQ using local file references.

How Grok Image API Works

  1. Credentials and API base URLs are identified through environment variables like IMAGE_API_BASE_URL.
  2. The user executes a script command specifying the task type: generate, edit, or probe.
  3. The skill constructs a standard JSON or multipart request for the targeted endpoint.
  4. Upon receiving a response, the skill automatically handles image downloading and local storage to the output directory.
  5. The local file path or generated URL is then made available for the user or downstream agent processes.

Grok Image API Setup

To start using this member of the Openclaw Skills collection, configure your environment and use the bundled Python script:

export IMAGE_API_BASE_URL="https://api.example.com/v1"
export IMAGE_API_KEY="your_api_key_here"

# Generate an image
python3 scripts/grok_image_api.py generate --prompt "a futuristic landscape" --out ./my_image.png

# Edit an image
python3 scripts/grok_image_api.py edit --image ./input.png --prompt "add a flying car" --out ./edited.png

Grok Image API Data Schema & Taxonomy

The skill maintains a structured approach to asset management:

Component Details
Default Path output/grok-images/
File Naming Customizable via the --out parameter
Payload Types JSON for generation, Multipart/Form-data for edits
Supported Presets Custom sizes, styles, and model tags as defined by the API

This structure ensures that Openclaw Skills can reliably track and reuse generated media across different sessions.

Grok Image API Advanced Features

  • Mask support for fine-grained image editing and inpainting.
  • Integration with QQ messaging via the tag system for automated image delivery.
  • Flexible parameter support including --style, --preset-size, and --extra for custom API keys.
  • Endpoint probing functionality to debug connectivity and API compatibility without generating full assets.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*