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

opencode-gpt-image-plugin

v0.1.0

Published

opencode plugin for OpenAI GPT image generation (gpt-image-2, gpt-image-1.5) via a CLIProxyAPI/OpenAI-compatible endpoint.

Readme

opencode-gpt-image-plugin

An opencode plugin that adds image generation with OpenAI's GPT image models through any OpenAI-compatible / CLIProxyAPI endpoint.

It registers one tool your agents can call:

| Tool | Purpose | Models | | --- | --- | --- | | gpt_image | Still images | gpt-image-2 (default), gpt-image-1.5 |

The agent picks the specific model via the model argument, guided by per-model hints baked into the tool schema, and can set size, quality, background, and output_format.

For adult/explicit image generation, use the companion opencode-grok-imagine-plugin; GPT image models refuse explicit content upstream.

Why a plugin (and not model config)

opencode's model config only drives the chat/completions interface. GPT image generation uses a different endpoint (/v1/images/generations) and returns base64 image data to write to disk. A plugin tool is the supported way to reach it and save results.

Install

npm install -D opencode-gpt-image-plugin

Then reference it in opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-gpt-image-plugin"]
}

Restart opencode (plugins load at startup).

Configure

Configuration is read from plugin options first, then environment variables.

Option A — environment variables

export GPT_IMAGE_BASE_URL="https://your-proxy.example.com"   # or CPA_BASE_URL
export GPT_IMAGE_API_KEY="sk-..."                            # or CPA_API_KEY
# Only for self-signed LAN proxies (see TLS below):
# export GPT_IMAGE_INSECURE_TLS=1

opencode.json:

{
  "plugin": ["opencode-gpt-image-plugin"]
}

Option B — plugin options (tuple form)

{
  "plugin": [
    ["opencode-gpt-image-plugin", {
      "baseURL": "https://your-proxy.example.com",
      "apiKey": "{env:MY_KEY}",
      "insecureTLS": false
    }]
  ]
}

Config matrix

| Setting | Plugin option | Env var(s) | Default | | --- | --- | --- | --- | | Base URL | baseURL | GPT_IMAGE_BASE_URL, CPA_BASE_URL | — (required) | | API key | apiKey | GPT_IMAGE_API_KEY, CPA_API_KEY | — (required) | | Skip TLS verify | insecureTLS | GPT_IMAGE_INSECURE_TLS | false |

The base URL may include or omit a trailing /v1; the plugin normalizes it.

TLS

TLS certificates are verified by default. Only disable verification for a self-signed LAN proxy you control, via insecureTLS: true or GPT_IMAGE_INSECURE_TLS=1.

Usage

Just ask an agent:

  • "generate an image of a minimalist mountain logo on white"gpt_image
  • "make a 1024x1536 transparent-background icon of a rocket"gpt_image

Where files are saved

  • Project assets — pass output_dir (e.g. assets/img, public/images).
  • Scratch / experiments — omit output_dir. Files go to a self-ignored <project>/.gpt-tmp/ folder.

gpt_image arguments

| Arg | Type | Notes | | --- | --- | --- | | prompt | string | required | | model | enum | gpt-image-2 | gpt-image-1.5 | | count | 1–4 | number of images | | size | enum | auto, 1024x1024, 1536x1024, 1024x1536 | | quality | enum | auto, low, medium, high | | background | enum | auto, transparent, opaque | | output_format | enum | png, jpeg, webp | | output_dir | string | asset path, or omit for scratch |

Depending on the upstream proxy, some parameters (notably exact size) may be approximated rather than honored precisely.

Response & endpoint

  • POST /v1/images/generations{ data: [{ b64_json }], size, quality, ... }

Notes

  • Model availability depends on your upstream account/proxy. The plugin surfaces the upstream error text when a model or parameter isn't available.
  • Content policy is enforced upstream by OpenAI, independent of this plugin.

License

MIT © Lu Cao