Skip to content
    ↑↓ select↵ openesc close
    English中文
    plfavreau

    Gpt Image

    v0.2.1Other
    opencode-gpt-image

    Plug-and-play image generation & editing tools for opencode, powered by OpenAI gpt-image-2.

    GitHub stars

    0

    Monthly installs

    766

    541 in 7 days

    Composite scoreSCORE

    36.2

    Multi-signal model

    Last commit

    1 month ago

    2026-07-17

    Install and configure

    opencode.json

    Writes to this project's opencode.json — applies to this repository only.

    opencode.json

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

    opencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    Image generation and editing tools for opencode, powered by OpenAI gpt-image-2.

    Add one line to your config and any agent can create and edit images.

    [!NOTE] Demo video coming soon.

    Install

    Add it to the plugin array in your opencode.json (global: ~/.config/opencode/opencode.json):

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

    Then set your OpenAI key (one of):

    export OPENAI_API_KEY="sk-..."
    # or store it once:
    echo "sk-..." > ~/.config/opencode/openai.key
    

    Restart opencode. Done.

    The key is a platform API key, billed per image — not the ChatGPT/Codex subscription.

    Tools

    Tool Does
    image_generate Text prompt (+ optional reference image(s)) -> image(s), saved to disk.
    image_edit Edit/transform existing image(s), optional mask, -> image(s).

    image_generate also accepts an optional image_paths array of existing reference images to guide/condition the generation.

    Both support size, quality, background, output_format, n, and output_path.

    Config

    Env var Purpose
    OPENAI_API_KEY API key (overrides the key file).
    OPENCODE_OPENAI_KEY_FILE Custom key-file path. Default ~/.config/opencode/openai.key.
    OPENCODE_IMAGE_MODEL Override the model. Default gpt-image-2 (try gpt-image-1-mini for cheaper output).

    License

    MIT