ZeroHub Image API for Openclaw

An advanced Openclaw Skills integration for zeroHub, enabling secure, automated text-to-image and image-to-image workflows directly inside your AI agent environment.

chenzihao0731
v1.0.1
May 31, 2026
1
606
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install zerohub-image-api

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install zerohub-image-api using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is ZeroHub Image API?

The ZeroHub Image API skill is a robust, developer-centric tool designed to integrate high-quality AI image generation into automated workflows. Operating within the Openclaw Skills framework, this skill enables your AI agents to seamlessly verify account balances, initiate text-to-image or image-to-image tasks using the default gpt-image-2 model, and track tasks via secure polling mechanisms.

Built with security and enterprise compliance in mind, the skill downloads generated image assets only to explicit, user-defined directories. It enforces strict domain constraints (HTTPS, zeroHub domain rules), limits file download sizes up to 25MB, and implements SSRF prevention against intranet, localhost, or link-local targets.

ZeroHub Image API Use Cases

  • Automating visual asset generation for blogs, marketing, and design within custom developer workflows using Openclaw Skills.
  • Integrating text-to-image capabilities into automated chatbots or content-creation agents.
  • Building secure media pipelines that strictly validate image hosts, download sizes, and SSL certificates.
  • Querying zeroHub account balances programmatically to prevent API outages during bulk generation.

How ZeroHub Image API Works

  1. The user provides the API key securely via the ZEROHUB_API_KEY environment variable.
  2. The agent executes the Python helper script to submit an image generation task (POST /v1/images/generations) with customizable prompts, aspect ratios, and quality parameters.
  3. The script continuously polls the task status (GET /v1/images/query/{task_id}) at a configurable interval until completion, failure, or timeout.
  4. Once complete, relative image URLs are resolved to absolute paths based on the base URL.
  5. The script securely downloads the images into the user-specified directory, strictly validating file size limits, hostnames, and HTTPS rules.
  6. A structured JSON response containing the task details and local file paths is returned for downstream workflows.

ZeroHub Image API Setup

First, configure your API credentials securely by setting up the required environment variable. Do not hardcode the key in your scripts.

# Set your API key securely
set +x
export ZEROHUB_API_KEY='your_sk_img_api_key'

Query Account Balance

Before kicking off generation tasks, verify your credit balance:

./scripts/zerohub_image_public.py balance

Generate and Download Image

Generate a new image and download it directly to a local directory:

./scripts/zerohub_image_public.py generate \
  --prompt 'A small red lobster mascot sitting on a lotus leaf, cute sticker style' \
  --size '1:1' \
  --quality low \
  --output-dir './outputs' \
  --download

Securely Download an Existing URL

To download assets from zeroHub using established security rules:

./scripts/zerohub_image_public.py download \
  --output-dir './outputs' \
  'https://zerohub.zhyy.ltd/api/image-gen/v1/images/assets/example_id'

ZeroHub Image API Data Schema & Taxonomy

Script Configuration Parameters

Command Parameter Description Default
generate --prompt Image description prompt (Required) None
generate --model The generation model to use gpt-image-2
generate --size Output image aspect ratio 1:1
generate --quality Quality preset (auto, low, medium, high) low
generate --download Automatically download files on success False
generate --output-dir Directory to store downloaded files None
* --max-download-bytes Limit file download size to avoid SSRF issues 26214400 (25MB)

Structured JSON Response Format

Successful execution of tasks yields a JSON structure similar to this, making downstream file parsing inside Openclaw Skills extremely straightforward:

{
  "task_id": "example-task-uuid",
  "status": "completed",
  "downloaded_files": [
    {
      "ok": true,
      "url": "https://zerohub.zhyy.ltd/api/image-gen/v1/images/assets/uuid.png",
      "path": "./outputs/zerohub-image-uuid.png",
      "filename": "zerohub-image-uuid.png",
      "content_type": "image/png",
      "size": 123456
    }
  ]
}

ZeroHub Image API Advanced Features

  • Strict Host Validation: By default, downloads are restricted strictly to zeroHub domains unless extended via --allowed-host to block unauthorized network calls.
  • Built-in SSRF Protection: Resolves target hostnames and blocks internal network calls to localhost, intranet addresses, private subnets, and reserve local loopbacks.
  • Relative URL Auto-Resolution: Intelligently expands relative asset paths returned by the zeroHub API (e.g., /api/image-gen/...) to absolute URLs using the API base URL.
  • Preview Image Filtering: Use the --no-preview-download flag to conserve bandwidth by omitting intermediate or preview generation steps.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*