npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

image-api-workbench

v2.0.1

Published

Reproducible OpenAI Images API and compatible-gateway generation, editing, diagnostics, and artifact verification.

Downloads

196

Readme

Image API Workbench

image-api-workbench is a local Codex skill for reproducible image generation, reference-image editing, route diagnostics, and artifact verification through the OpenAI Images API or compatible gateways such as NewAPI.

It replaces newapi-imagegen. The new name describes the capability rather than binding the workflow to one gateway implementation.

Quick Start

Install the command-line tools from npm:

npm install --global image-api-workbench

Python 3.9 or newer is required at runtime. The CLI itself uses only the Python standard library.

Dry-run a current GPT Image request:

image-api-workbench \
  --prompt "A clean editorial AI infrastructure cover, no text, no logos" \
  --size 1536x864 \
  --quality high \
  --out ./artifacts/cover.png \
  --dry-run

Inspect the configured gateway catalog without generating an image:

image-api-workbench --list-remote-models

Generate a transparent image:

image-api-workbench \
  --prompt "A transparent editorial icon of an AI accelerator, no text" \
  --model gpt-image-2 \
  --background transparent \
  --output-format png \
  --out ./artifacts/icon.png

Edit a reference image:

image-api-workbench \
  --input-image ./artifacts/master-zh.png \
  --prompt "Preserve every non-text visual detail and replace only visible Chinese copy with clear English." \
  --size 1536x864 \
  --quality high \
  --out ./artifacts/master-en.png

Request streaming partial images from a compatible endpoint:

image-api-workbench \
  --prompt "A cinematic industrial robot assembly line, no text" \
  --stream \
  --partial-images 2 \
  --partial-dir ./artifacts/partials \
  --out ./artifacts/final.png

Configuration

Secret/config resolution:

  1. CLI --token-file and --base-url;
  2. current process environment;
  3. <cwd>/.content-skills/.env;
  4. ~/.content-skills/.env;
  5. /root/.openclaw/new-api.token when present.

Supported environment variables:

NEWAPI_API_KEY
NEW_API_KEY
OPENAI_API_KEY
IMAGE_API_KEY
NEWAPI_BASE_URL
OPENAI_BASE_URL
OPENAI_API_BASE
IMAGE_API_BASE_URL
NEWAPI_TOKEN_FILE
IMAGE_API_TOKEN_FILE
IMAGE_API_TIMEOUT_SECONDS

Prefer an environment variable or a permission-restricted token file. Do not put keys in prompts, shell history, skill files, reports, metadata, or memory.

Main Options

--prompt TEXT
--prompt-file PATH
--out PATH
--mode generation|edit
--input-image PATH              Repeatable, maximum 16
--mask PATH
--model MODEL                   Default: gpt-image-2
--size auto|WIDTHxHEIGHT|preset
--quality auto|low|medium|high
--n 1..10
--background auto|opaque|transparent
--output-format png|jpeg|webp
--output-compression 0..100
--moderation auto|low
--input-fidelity low|high
--stream
--partial-images 0..3
--partial-dir DIR
--metadata-out PATH|none
--include-prompt-preview
--list-model-profiles
--list-size-presets
--list-remote-models
--dry-run

Known-model validation is strict by default. Use --allow-provider-extensions only after checking the target gateway's documentation and exact endpoint behavior.

Bilingual Review

Create a contact sheet after reference-image localization:

image-api-bilingual-review \
  --left-dir ./artifacts/zh-CN \
  --right-dir ./artifacts/en \
  --left-label "Chinese master" \
  --right-label "English edit" \
  --title "Localized image review" \
  --out ./artifacts/localized-review.html

The contact sheet writes HTML plus a JSON metadata sidecar containing file hashes, dimensions, byte sizes, and missing-pair status.

Codex Skill Installation

The npm package includes the complete Skill source. To install it into Codex instead of using only the global CLI:

mkdir -p ~/.codex/skills
cp -R "$(npm root --global)/image-api-workbench" \
  ~/.codex/skills/image-api-workbench

Verification

After a real request, check:

file ./artifacts/cover.png
sed -n '1,260p' ./artifacts/cover.png.meta.json

The sidecar records requested and actual dimensions separately. A requested 3840x2160 image that returns another size is not native 4K and must not be reported as such.

Scope Boundary

This package intentionally owns reproducible Images API requests. OpenAI's Responses API image-generation tool is a separate conversational/multi-turn surface and is documented in references/model-support.md; this CLI does not pretend that an Images API request is a Responses API workflow.