Openai Image Gen

Generate images using OpenAI's DALL-E API. Use when this capability is needed.

tomevault-io Updated

File contents

OpenAI Image Generation

Generate images with DALL-E via the OpenAI API.

Generate an Image

curl -s "https://api.openai.com/v1/images/generations" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "A serene mountain landscape at sunset",
    "n": 1,
    "size": "1024x1024"
  }' | jq '.data[0].url'

Edit an Image

curl -s "https://api.openai.com/v1/images/edits" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F image="@original.png" \
  -F mask="@mask.png" \
  -F prompt="Add a rainbow in the sky" \
  -F n=1 \
  -F size="1024x1024" | jq '.data[0].url'

Variations

curl -s "https://api.openai.com/v1/images/variations" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F image="@original.png" \
  -F n=3 \
  -F size="1024x1024" | jq '.data[].url'

Converted and distributed by TomeVault — claim your Tome and manage your conversions.

tomevault-io/skills-registry/tree/main/kody-w--openrappter--openai-image-gen commit 3f5b6e0c2d

Frequently asked questions

npx skillmds@latest add tomevault-io/openai-image-gen-8