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 and optional masks, test an image endpoint, or integrate /v1/images/generations or /v1/images/edits into scripts or projects.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "grok-image-api" with this command: npx skills add xiaolozee/grok-image-api

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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Zhipu Image Generator

AI text-to-image generation using Zhipu AI's GLM-Image model. Use when the user requests image generation, creating images from text descriptions, or mention...

Registry SourceRecently Updated
3791Profile unavailable
General

feishu-doc-extended

飞书文档扩展工具,提供图片下载和 OCR 识别功能。需要配合内置 feishu 插件使用。

Registry SourceRecently Updated
3371Profile unavailable
General

Jimeng AI Image Generator

即梦AI生图与视频生成工具。通过火山引擎API调用即梦AI,支持文生图、图片生成、视频生成。内置50+提示词模板覆盖电商、社交、商业设计、视频等场景。

Registry SourceRecently Updated
670Profile unavailable
General

Image Forge

画图技能路由中枢(统一入口)。三维路由体系(用途 × 风格 × 主体),双后端调度。 - Signature 风格:10 种有独立 YAML 的视觉方案(构成主义/克莱因/Risograph/故障艺术等) - Rendering 风格:15 种通用渲染技法 modifier(写真/动漫/3D/水彩/赛博朋克等),...

Registry SourceRecently Updated
940Profile unavailable