🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

opencode-gpt-imagegen

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opencode-gpt-imagegen

OpenCode plugin for GPT Image 2 generation through your ChatGPT subscription, with reference images and safe PNG output.

latest
Source
npmnpm
Version
0.1.8
Version published
Weekly downloads
95
-1.04%
Maintainers
1
Weekly downloads
 
Created
Source

opencode-gpt-imagegen

opencode-gpt-imagegen × gpt-image-2

Bring ChatGPT Images 2.0 (gpt-image-2) to OpenCode. Use it through your ChatGPT subscription (no API costs!) or through the OpenAI API — your call.

OpenCode plugin npm version CI license: MIT

Auth pathStatusBilling
ChatGPT subscription (OAuth)Available now in v0.1.0No extra cost — comes out of your existing Plus / Pro / Business plan
OpenAI API keyComing soon in v0.2.0Pay-per-image against your API credits, with generate + edit support

Highlights

  • Subscription-friendly. Generations ride on the same Codex backend channel OpenCode already uses for ChatGPT subscription chat — billed against your ChatGPT plan, not your API credits.
  • Reference images. Pass any number of input images alongside the prompt for style guidance, edit targets, or compositing inputs.

Installation

Add this plugin to your OpenCode config. For example, in opencode.json:

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

OpenCode auto-installs the package via Bun on next launch — no separate npm install step is needed. The plugin requires OpenCode to be authenticated with ChatGPT.

Usage

Just ask your agent in natural language and gpt_imagegen will be picked up.

The three examples below are the actual outputs of this repo's e2e test suite — see tests/e2e.test.ts for the exact prompts and assertions.

Example A — generate

Draw a man in a navy samue with a red hachimaki, standing in a garden full of cherry blossoms. 90s anime style. Save it as character.png, portrait 1024x1536.

Example A output: man in samue, portrait

Example B — auto-versioning

gpt_imagegen never overwrites an existing file: when the out path is already taken, it picks -v2, -v3, … instead.

Now do the same path but make it a woman in a yellow yukata holding a red wagasa, in a moonlit garden with fireflies. Landscape 1536x1024.

The previous character.png is left untouched; the new image lands at character-v2.png.

Example B output: woman in yukata, landscape (auto-versioned)

Example C — feed existing image files as input

Pass any number of image paths via the images argument and the model uses them as references for the next generation — for style guidance, characters to keep, scenes to extend, and so on.

Take character.png and character-v2.png and put both characters together on the engawa of an old Japanese house, smiling at the viewer. 2048x1152, same 90s anime style.

Example C output: both characters composed onto an engawa

Roadmap

VersionAuth pathScopeStatus
v0.1.0ChatGPT subscriptiongpt_imagegen with optional reference images (generation + reference-guided edits via prompting)Released
v0.2.0OpenAI API keyAdds the API-key billing path: both generate (/v1/images/generations) and edit (/v1/images/edits) with reference imagesNext
v0.3.0OpenAI API keyAdds pixel-precise mask inpainting via /v1/images/edits (binary PNG alpha mask)Planned

How it works

OpenCode already talks to the OpenAI Codex backend to power ChatGPT subscription chat. This plugin reuses that same endpoint, attaching the hosted image_generation tool to a single-turn request, then writes the returned PNG to disk. Auth is read from OpenCode's standard auth.json; no new credential surface is introduced.

Disclaimer

This is an unofficial, third-party plugin, not affiliated with or endorsed by OpenAI or OpenCode.

It uses the same Codex backend endpoint OpenCode itself calls for ChatGPT subscription chat — this plugin just adds the hosted image_generation tool to that conversation. Use must comply with OpenAI's Terms of Use and Usage Policies.

Keywords

opencode

FAQs

Package last updated on 31 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts