OpenAI GPT Image API

Pro v1.0.0

Generate, edit, and create variations of images using OpenAI's GPT Image and DALL-E models via API

Requires Claude Code CLI

This skill integrates with OpenAI through Claude Code. Install Claude Code and add this skill to use it.

Available Actions

Generate Images

Create images from text descriptions using GPT Image or DALL-E models

Parameters

Name Type Required Description
prompt string Required Text description of the image to generate (max 32000 chars for GPT Image)
model string Optional Model to use for generation
size string Optional Size of generated images
quality string Optional Quality level (GPT Image models only)
n integer Optional Number of images to generate (1-10)
response_format string Optional Format of the response

Returns

object Generated image data

Try saying...

  • "Generate an image of a futuristic city at sunset"
  • "Create a photorealistic portrait of a wise elderly person"
  • "Generate a minimalist logo design for a tech startup"
  • "Create an oil painting style landscape with mountains and a lake"

Edit Images

Modify existing images using text prompts and optional masks

Parameters

Name Type Required Description
image string Required Path to the source image file (PNG, WEBP, or JPG < 50MB for GPT Image)
prompt string Required Description of the desired edits
model string Optional Model to use for editing
mask string Optional Path to mask image (transparent areas indicate where to edit)
n integer Optional Number of variations to generate (1-10)
response_format string Optional Format of the response

Returns

object Edited image data

Try saying...

  • "Edit this product photo to have a professional studio background"
  • "Remove the background from this image"
  • "Add snowfall to this winter landscape photo"
  • "Change the color scheme of this design to blue tones"

Create Variations

Generate different versions of an existing image while maintaining style and composition

Parameters

Name Type Required Description
image string Required Path to the source image (must be square PNG < 4MB)
n integer Optional Number of variations to generate (1-10)
size string Optional Size of variations
response_format string Optional Format of the response

Returns

object Variation image data

Try saying...

  • "Create variations of this logo design"
  • "Generate alternative versions of this concept art"
  • "Make different variations of this pattern"
  • "Create style variations of this illustration"

Getting Started

API Key Easy Setup
  1. 1 Go to OpenAI Platform: https://platform.openai.com/api-keys
  2. 2 Sign in or create an account
  3. 3 Click 'Create new secret key'
  4. 4 Give it a descriptive name (e.g., 'Claude Image Generation')
  5. 5 Copy the key (shown only once)
  6. 6 Add to shell config: echo 'export OPENAI_API_KEY="YOUR_KEY"' >> ~/.zshrc
  7. 7 Restart terminal or run: source ~/.zshrc

Verify Setup

[ -n "$OPENAI_API_KEY" ] && echo "API key configured" || echo "API key not found"

Success: API key configured

Security & Access

Access Scope

Full access to OpenAI Image API with usage costs based on generation parameters. Can generate, edit, and create variations of images.

  • API key grants access to your OpenAI account and incurs usage charges
  • Never share your API key or commit it to version control
  • Image generation costs vary: low (~$0.02), medium (~$0.07), high (~$0.19) per square image
  • Generated image URLs are public and expire after 60 minutes
  • All prompts and images are subject to OpenAI's content policy
  • Consider rotating API keys periodically for security

Limitations

  • Complex prompts may take up to 2 minutes to process
  • Text rendering in images may have minor clarity issues
  • Visual consistency for recurring characters can be challenging
  • Precise element placement requires careful prompting
  • DALL-E 2 and DALL-E 3 are deprecated (EOL May 12, 2026)
  • Image URLs expire after 60 minutes
  • All content is filtered per OpenAI's content policy

Get This Skill

Requires Pro subscription ($9/month)

Quick Reference

Type
PYTHON_SDK
Auth
API Key
Setup
Easy Setup
Tools Required
Bash
Python Dependencies
openai>=1.0.0

Have Feedback?

Help us improve this skill by sharing your ideas and suggestions.

Request Improvements