Back to Skills

openai-image-gen

Batch-generate images via OpenAI Images API. Random prompt sampler + `index.html` gallery.

1,738stars165forksUpdated 2/10/2026

Security Assessment

Safe(100/100)
Security Score100/100

About openai-image-gen

The `openai-image-gen` skill provides a streamlined way to generate multiple images using the OpenAI Images API. It solves the problem of manually creating prompts and managing outputs by offering a batch generation process with a built-in random prompt sampler. Users can automatically generate diverse, structured prompts and render them into images, simplifying workflows for creative projects, prototyping, or content generation where multiple visual outputs are needed quickly.

Key features of this skill include automated prompt generation, flexible command-line options for specifying prompt text, image count, resolution, and output directories, as well as support for selecting different image models. The outputs are organized into PNG files, a JSON mapping of prompts to generated files, and an HTML gallery (`index.html`) for easy browsing. The skill requires an OpenAI API key to function and is designed to run from any directory, making it portable and adaptable to different project structures.

This skill is ideal for designers, developers, and AI enthusiasts who need to create visual content efficiently. It can be used for generating concept art, illustrations, visual datasets, or simply exploring creative image generation ideas. By automating the prompt creation and generation process, it reduces repetitive manual effort and accelerates experimentation with AI-generated imagery.

FAQ

How do I set up the openai-image-gen skill?

You need to have an environment variable `OPENAI_API_KEY` set with your OpenAI API key. Once set, you can run the generation script from any directory.

What output files does this skill generate?

It generates PNG images for each prompt, a `prompts.json` file mapping prompts to their images, and an `index.html` file that serves as a thumbnail gallery.

Can I customize the prompts or number of images generated?

Yes, you can specify a custom prompt, the number of images with `--count`, choose the image model with `--model`, adjust image size with `--size`, set quality with `--quality`, and define an output directory using `--out-dir`.

Is this skill compatible with any operating system?

As it is a Python-based script, it is compatible with systems that can run Python 3 and have access to the OpenAI API, including Linux, macOS, and Windows.

Are there any limitations to using this skill?

You must have a valid OpenAI API key, and the outputs depend on the availability and limits of the OpenAI Images API. The skill does not include additional image editing capabilities beyond generation.

Install openai-image-gen

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill