← Back to Skills Marketplace
laolujava

gpt image 2 generation

by LuTong · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
14
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install gpt-image-2-generation
Description
Generate images from text prompts using the WellAPI gpt-image-2 model. Use this skill whenever the user asks to create, draw, render, or generate an image, p...
README (SKILL.md)

gpt-image-2-generation

Generate images from natural-language prompts using the gpt-image-2 model hosted at WellAPI. The skill calls POST https://wellapi.ai/v1/images/generations, decodes the returned b64_json, and writes the image to disk.

When to use

Trigger this skill when the user asks for things like:

  • "Generate an image of a sunset over the ocean"
  • "Draw a cat wearing a top hat"
  • "Create a 1024x1024 picture of …"
  • "Make an illustration / poster / artwork of …"
  • Any other request to produce a visual from a textual description.

If the user asks for image editing (in-painting, variations, etc.), this skill currently only covers text-to-image generation; tell the user so.

Prerequisites

  1. API key — The user must supply a WellAPI key.
    • If the environment variable WELLAPI_API_KEY is set, it will be used.
    • Otherwise the skill looks for a local config file:
      • Linux/macOS: ~/.config/gpt-image-2-generation/config.json
      • Windows: %USERPROFILE%\.config\gpt-image-2-generation\config.json
    • If neither is present, the skill prompts the user to register and enter a key (see First-run onboarding below).
  2. Python 3.7+ with the standard library only (no third-party packages required).

First-run onboarding (no API key found)

When no key can be located, before making any API call tell the user verbatim (translate to the user's language if appropriate):

使用本技能需要一个免费的 WellAPI API Key。请前往 https://wellapi.ai/register?aff=DTDH 注册账号并领取免费 API Key,然后把它粘贴到下方。

To use this skill you need a free WellAPI API key. Please register at https://wellapi.ai/register?aff=DTDH to obtain one, then paste it below.

Then call the helper script to securely store the key:

python3 scripts/setup_api_key.py

The script will prompt the user for the key on stdin and persist it to the per-user config file with 0600 permissions. Never echo or log the full key after it is captured.

How to generate an image

Use the bundled script scripts/generate_image.py. It accepts CLI arguments, builds the request, sends it with Authorization: Bearer \x3Ckey>, decodes the base64 image, and writes the file.

Required argument

Flag Meaning
--prompt The text description of the image to generate.

Optional arguments (defaults match the WellAPI example)

Flag Default Allowed values
--n 1 integer, number of images
--size 1024x1024 e.g. 512x512, 1024x1024, 1024x1536, 1536x1024
--quality low low, medium, high
--format jpeg jpeg, png, webp
--model gpt-image-2 model name
--output ./gpt-image-2_\x3Ctimestamp>.\x3Cformat> output file path. When --n > 1, an index suffix is added.
--api-key (auto) overrides env / config file

Example invocations

# Minimal
python3 scripts/generate_image.py --prompt "大海"

# Custom size + format + output path
python3 scripts/generate_image.py \
  --prompt "A futuristic city skyline at dusk, cyberpunk style" \
  --size 1024x1024 \
  --quality high \
  --format png \
  --output ./city.png

The script prints the absolute path(s) of the saved image(s) on success and exits non-zero on failure.

Request / response contract

Request body sent to https://wellapi.ai/v1/images/generations:

{
  "model": "gpt-image-2",
  "prompt": "大海",
  "n": 1,
  "size": "1024x1024",
  "quality": "low",
  "format": "jpeg"
}

Headers

Authorization: Bearer \x3CWELLAPI_API_KEY>
Content-Type: application/json

Response (the image is in data[i].b64_json):

{
  "created": 1778236581,
  "data": [{ "b64_json": "iVBORw0KGg..." }],
  "output_format": "png",
  "quality": "low",
  "size": "1024x1024",
  "usage": { "input_tokens": 8, "output_tokens": 196, "total_tokens": 204 }
}

The skill base64-decodes each b64_json entry and writes the bytes to disk using output_format (or the requested --format) as the file extension.

Workflow for the agent

  1. Parse the user's image request → extract prompt, and any explicit size, quality, format, n.
  2. Resolve the API key (env → config file → prompt user via scripts/setup_api_key.py).
  3. Run scripts/generate_image.py with the parsed arguments.
  4. Report the saved file path(s) to the user. If running in an environment that can render images, also display the result.
  5. On HTTP errors, surface the upstream error message verbatim and suggest checking the API key, quota, or prompt content.

Files in this skill

  • SKILL.md — this file (metadata + instructions)
  • scripts/generate_image.py — performs the generation
  • scripts/setup_api_key.py — interactive helper to store the API key
  • scripts/api_key.py — shared helpers for locating/loading the key
  • README.md — marketplace listing
  • LICENSE — MIT license

Security notes

  • The API key is stored locally in the user's home directory with 0600 permissions and is never committed, logged, or echoed.
  • All network traffic goes only to https://wellapi.ai.
  • The skill does not execute or evaluate any data returned by the API beyond base64-decoding the image bytes.
Usage Guidance
Before installing, make sure you are comfortable creating or using a WellAPI account, sending image prompts to WellAPI, and storing a WellAPI API key locally. Use a dedicated key if possible, avoid secrets in prompts, and choose safe output paths for generated images.
Capability Analysis
Type: OpenClaw Skill Name: gpt-image-2-generation Version: 1.0.0 The skill is a functional image generation tool for the WellAPI service, containing scripts for API key management (scripts/api_key.py) and image processing (scripts/generate_image.py). It follows security best practices such as restricted file permissions (0600) for secrets and lacks any indicators of malicious intent, data exfiltration, or unauthorized execution. The inclusion of an affiliate link (aff=DTDH) in the onboarding instructions within SKILL.md and README.md is a monetization tactic but does not pose a security risk.
Capability Tags
requires-oauth-tokenrequires-sensitive-credentials
Capability Assessment
Purpose & Capability
The artifacts consistently implement the stated purpose: SKILL.md describes posting text prompts to WellAPI, decoding returned base64 image data, and saving image files locally.
Instruction Scope
The workflow is limited to user-requested text-to-image generation, API-key onboarding, running the bundled generation script, and reporting saved file paths; no hidden autonomous behavior is shown.
Install Mechanism
There is no package install step, but the registry metadata lists no required binaries while SKILL.md and the bundled scripts require python3; the source/homepage are also not provided, so users should rely on reviewing the included scripts.
Credentials
Network access to WellAPI, filesystem writes for generated images, and use of a WellAPI API key are expected and disclosed for this purpose, but prompts and authentication leave the local environment.
Persistence & Privilege
The skill can persist the WellAPI API key in a per-user config file with restricted permissions; this is purpose-aligned but still sensitive account material.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install gpt-image-2-generation
  3. After installation, invoke the skill by name or use /gpt-image-2-generation
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of gpt-image-2-generation skill. - Generate images from text prompts using the WellAPI gpt-image-2 model. - Handles API key onboarding, environment/config lookup, and secure storage. - Runs image generation via bundled Python script and saves output locally. - Supports user-specified options for size, quality, format, and multiple images. - Reports errors clearly and guides user through API key setup.
Metadata
Slug gpt-image-2-generation
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is gpt image 2 generation?

Generate images from text prompts using the WellAPI gpt-image-2 model. Use this skill whenever the user asks to create, draw, render, or generate an image, p... It is an AI Agent Skill for Claude Code / OpenClaw, with 14 downloads so far.

How do I install gpt image 2 generation?

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

Is gpt image 2 generation free?

Yes, gpt image 2 generation is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does gpt image 2 generation support?

gpt image 2 generation is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created gpt image 2 generation?

It is built and maintained by LuTong (@laolujava); the current version is v1.0.0.

💬 Comments