← Back to Skills Marketplace
🔌

HiAPI GPT Image 2

by HiAPI AI · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
33
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install hiapi-gpt-image-2
Description
Generate images with HiAPI's GPT Image 2 family via the HiAPI unified async task API. Use when a user asks to create or edit an image with GPT Image 2, HiAPI...
README (SKILL.md)

HiAPI GPT Image 2

Use this skill when the user wants image generation through the HiAPI GPT Image 2 family.

Requirements

  • Node.js 18 or newer.
  • HIAPI_API_KEY must be set in the environment.
  • HIAPI_BASE_URL is optional and defaults to https://api.hiapi.ai.

Important links:

Never invent an image result. If the API call fails, report the status code, compact error message, and the next action from the Error Guidance section.

Generate An Image

Run:

node scripts/hiapi-gpt-image-2.mjs --prompt "Create a launch poster for an AI note app" --aspect-ratio 16:9

Supported models:

  • gpt-image-2
  • gpt-image-2-pro
  • gpt-image-2-image-to-image
  • gpt-image-2-image-to-image-pro

For image-to-image requests, use one of the image-to-image models and pass --input-url once per reference image. The API field is input.input_urls; supported count is 1 to 5 images.

Supported aspect ratios:

  • auto
  • 1:1
  • 3:2
  • 2:3
  • 16:9
  • 9:16
  • 4:3
  • 3:4
  • 5:4
  • 4:5
  • 2:1
  • 1:2
  • 3:1
  • 1:3
  • 21:9
  • 9:21

Supported resolutions:

  • 1K
  • 2K
  • 4K

Pro models (gpt-image-2-pro, gpt-image-2-image-to-image-pro) only support 1K and 2K, and a narrower aspect ratio set (no 2:1, 1:2, 3:1, 1:3, 9:21; plain pro also has no auto).

Cross-field constraints for gpt-image-2 and gpt-image-2-image-to-image:

  • aspect_ratio=auto (or omitted) only supports resolution=1K.
  • aspect_ratio=1:1 cannot be combined with resolution=4K.

The script writes generated data URI images to outputs/ and prints JSON with the saved file paths or remote URLs.

API Contract

This skill calls:

POST /v1/tasks
GET /v1/tasks/{taskId}

with:

{
  "model": "gpt-image-2",
  "input": {
    "prompt": "...",
    "aspect_ratio": "16:9",
    "resolution": "1K"
  }
}

Image-to-image:

{
  "model": "gpt-image-2-image-to-image-pro",
  "input": {
    "prompt": "...",
    "input_urls": ["https://example.com/source.png"],
    "aspect_ratio": "auto",
    "resolution": "2K"
  }
}

POST /v1/tasks returns data.taskId. Poll GET /v1/tasks/{taskId} until status is success. Expected image output is in data.output[], commonly:

{
  "data": {
    "status": "success",
    "output": [{ "type": "image", "url": "https://cdn.example.com/image.png" }]
  }
}

For details, read references/api.md and references/output.md.

Check Configuration

Run:

node scripts/check-config.mjs

Use --live only when you want to verify that the configured key can reach the HiAPI pricing endpoint.

Error Guidance

  • Missing HIAPI_API_KEY: tell the user to create or copy a key from https://www.hiapi.ai/en/register and export it.
  • HTTP 401 or 403: tell the user to verify the HiAPI API key.
  • HTTP 402, insufficient balance, credits, quota, or payment errors: tell the user to add credits or check billing at https://www.hiapi.ai/en/dashboard and review pricing at https://www.hiapi.ai/en/pricing.
  • HTTP 429: tell the user to wait and retry or reduce concurrent image generations.
  • Content policy or safety errors: ask the user to revise the prompt.
  • No extractable image: explain that this skill expects data.output[] to contain an image URL or data URI after the task succeeds.
  • Optional skill update notice: tell the user the printed update command can be run later.
  • Required skill update notice: tell the user the printed update command must be run before using this skill again.
Usage Guidance
Install only if you trust HiAPI with the prompts, reference image URLs, and generated outputs you send. Keep HIAPI_BASE_URL at the default unless you intentionally use a trusted proxy, and avoid running the installer over a locally modified hiapi-gpt-image-2 skill folder you want to preserve.
Capability Tags
requires-paid-servicerequires-oauth-tokenrequires-sensitive-credentials
Capability Assessment
Purpose & Capability
The stated purpose is generating or editing images through HiAPI GPT Image 2, and the scripts build image task payloads, send them to HiAPI, poll for completion, and return saved file paths or URLs.
Instruction Scope
Implicit invocation is enabled, but the skill description narrows use to user requests to create or edit images with GPT Image 2 or this specific skill; users should still expect API calls when such requests are made.
Install Mechanism
The installer uses git to clone the published repository and replaces an existing hiapi-gpt-image-2 folder under the selected skills directory; this is purpose-aligned but can overwrite local modifications to that skill folder.
Credentials
The skill requires a HiAPI API key and sends prompts, optional input image URLs, and task polling requests to the configured HiAPI base URL; this is proportionate for image generation and is disclosed.
Persistence & Privilege
Generated data-URI images are saved to an outputs directory by default, with a --no-save option available; no background persistence, privilege escalation, or unrelated local indexing was found.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install hiapi-gpt-image-2
  3. After installation, invoke the skill by name or use /hiapi-gpt-image-2
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of HiAPI GPT Image 2 integration. - Supports generating and editing images using the HiAPI GPT Image 2 model family via a unified async task API. - Allows selection of models, aspect ratios, and resolutions with detailed cross-field constraints and guidance. - Provides built-in error handling and next steps for common API failure scenarios. - Outputs image files to the `outputs/` directory, printing file paths or URLs in JSON. - Includes CLI tools for image generation and configuration checking.
Metadata
Slug hiapi-gpt-image-2
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is HiAPI GPT Image 2?

Generate images with HiAPI's GPT Image 2 family via the HiAPI unified async task API. Use when a user asks to create or edit an image with GPT Image 2, HiAPI... It is an AI Agent Skill for Claude Code / OpenClaw, with 33 downloads so far.

How do I install HiAPI GPT Image 2?

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

Is HiAPI GPT Image 2 free?

Yes, HiAPI GPT Image 2 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does HiAPI GPT Image 2 support?

HiAPI GPT Image 2 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created HiAPI GPT Image 2?

It is built and maintained by HiAPI AI (@hiapiai); the current version is v1.0.0.

💬 Comments