← Back to Skills Marketplace
xiaolozee

Grok Image API

by XiaoLozee · GitHub ↗ · v1.1.1
cross-platform ✓ Security Clean
350
Downloads
0
Stars
1
Active Installs
2
Versions
Install in OpenClaw
/install grok-image-api
Description
Work with OpenAI-compatible image generation and image editing endpoints. Use when the user wants to generate images from prompts, edit images with prompts a...
README (SKILL.md)

Grok Image API

Use this skill to work with image endpoints that expose:

  • POST /v1/images/generations
  • POST /v1/images/edits

Prefer practical workflows: generate or edit an image, save the result locally, and then send or reuse the saved file.

Quick start

Prefer the bundled script:

  • scripts/grok_image_api.py generate for text-to-image
  • scripts/grok_image_api.py edit for image editing
  • scripts/grok_image_api.py probe to verify the endpoint is reachable

Default environment variables:

  • IMAGE_API_BASE_URL
  • IMAGE_API_KEY

Workflow

  1. Identify the task: generate or edit.
  2. Load credentials through environment variables.
  3. For generation, send JSON to /v1/images/generations.
  4. For editing, send multipart form data to /v1/images/edits with image and optional mask.
  5. Save the returned image locally. If the API returns a URL, download it locally by default.
  6. If the user is on QQ and wants the image delivered, reply with a \x3Cqqimg> tag pointing to the local file or returned URL.

Generation

Example:

IMAGE_API_BASE_URL="https://example.com/v1" \
IMAGE_API_KEY="..." \
python3 scripts/grok_image_api.py generate \
  --style anime \
  --preset-size portrait \
  --prompt "a cozy cyberpunk tea shop at night" \
  --out /tmp/generated.png

Use --size or --preset-size, --style, --model, --n, and --extra key=value when needed.

Editing

Example:

IMAGE_API_BASE_URL="https://example.com/v1" \
IMAGE_API_KEY="..." \
python3 scripts/grok_image_api.py edit \
  --image /absolute/path/input.png \
  --style cute \
  --prompt "replace the background with a sunset beach" \
  --out /tmp/edited.png

Add --mask /absolute/path/mask.png if the API supports masked edits.

Notes

  • Assume this service is not a full chat-completions endpoint.
  • Do not call unrelated routes unless the user explicitly says they exist.
  • Avoid echoing secrets back to the user.
  • Prefer local saved files for messaging channels that can upload local images.
  • Default output directory is a local output/grok-images/ folder when --out is omitted.

References

Read references/api-notes.md when you need a compact reminder of request/response patterns, presets, and output behavior.

Usage Guidance
This skill appears to do what it says: a local Python helper to call image generation/edit APIs. Before installing or running it, ensure you: (1) only provide an API base URL and API key for a trusted image service (the script will read IMAGE_API_BASE_URL or GROK_IMAGE_BASE_URL and IMAGE_API_KEY or GROK_IMAGE_API_KEY); (2) are comfortable that editing will upload any local image path you supply to that external service; and (3) note the registry metadata omitted the required env vars — double-check SKILL.md and the script for the exact variable names. If in doubt, run the script in a sandbox or review the code (it's included and uses only the Python standard library).
Capability Analysis
Type: OpenClaw Skill Name: grok-image-api Version: 1.1.1 The skill is a legitimate tool for interacting with OpenAI-compatible image generation and editing APIs. It includes a Python script (scripts/grok_image_api.py) that uses the standard library to perform HTTP requests and manage local file storage for generated images. No indicators of data exfiltration, malicious execution, or prompt injection were found.
Capability Assessment
Purpose & Capability
The skill name and description match the included script and SKILL.md: it targets POST /v1/images/generations and /v1/images/edits and provides generate/edit/probe actions. One minor inconsistency: the registry metadata lists no required environment variables, but both SKILL.md and the script expect IMAGE_API_BASE_URL (or GROK_IMAGE_BASE_URL) and IMAGE_API_KEY (or GROK_IMAGE_API_KEY). Otherwise the requested capabilities are proportionate to the stated purpose.
Instruction Scope
The runtime instructions and script are scoped to calling the image endpoints, saving results locally, and (for edits) uploading user-provided image files. The skill reads only the API env vars, accepts file paths supplied by the user, writes output under output/grok-images/, and will download returned URLs by default. There are no instructions to read unrelated system files or to send data to endpoints outside the configured IMAGE_API_BASE_URL.
Install Mechanism
There is no install spec (instruction-only skill) and the bundled Python script uses only the standard library. Nothing is downloaded from external URLs or installed during skill setup, so installation risk is low.
Credentials
The script legitimately requires an API base URL and API key (IMAGE_API_BASE_URL / IMAGE_API_KEY or alternates) to talk to the image service. The proportionality is appropriate for the task. However, the registry metadata did not declare these required environment variables, which is an omission that could mislead users about what secrets the skill needs.
Persistence & Privilege
The skill does not request persistent or elevated platform privileges (always is false). It does not modify other skills or system-wide agent settings. Autonomous invocation is allowed (default) but not combined with other concerning behaviors.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install grok-image-api
  3. After installation, invoke the skill by name or use /grok-image-api
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.1
Make the public skill more generic: remove local secrets wrapper, remove fixed workspace paths, and document environment-driven configuration.
v1.1.0
Add local output saving, URL auto-download, style and size presets, wrapper shortcuts, and better errors.
Metadata
Slug grok-image-api
Version 1.1.1
License
All-time Installs 1
Active Installs 1
Total Versions 2
Frequently Asked Questions

What is Grok Image API?

Work with OpenAI-compatible image generation and image editing endpoints. Use when the user wants to generate images from prompts, edit images with prompts a... It is an AI Agent Skill for Claude Code / OpenClaw, with 350 downloads so far.

How do I install Grok Image API?

Run "/install grok-image-api" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Grok Image API free?

Yes, Grok Image API is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Grok Image API support?

Grok Image API is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Grok Image API?

It is built and maintained by XiaoLozee (@xiaolozee); the current version is v1.1.1.

💬 Comments