← 返回 Skills 市场
xiaolozee

Grok Image API

作者 XiaoLozee · GitHub ↗ · v1.1.1
cross-platform ✓ 安全检测通过
350
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (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.

安全使用建议
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).
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install grok-image-api
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /grok-image-api 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug grok-image-api
版本 1.1.1
许可证
累计安装 1
当前安装数 1
历史版本数 2
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 350 次。

如何安装 Grok Image API?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install grok-image-api」即可一键安装,无需额外配置。

Grok Image API 是免费的吗?

是的,Grok Image API 完全免费(开源免费),可自由下载、安装和使用。

Grok Image API 支持哪些平台?

Grok Image API 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Grok Image API?

由 XiaoLozee(@xiaolozee)开发并维护,当前版本 v1.1.1。

💬 留言讨论