# Image Gen

> >

- **Type:** Skill
- **Install:** `agentstack add skill-claude-world-claude-agent-image-gen`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [claude-world](https://agentstack.voostack.com/s/claude-world)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [claude-world](https://github.com/claude-world)
- **Source:** https://github.com/claude-world/claude-agent/tree/main/.claude/skills/image-gen

## Install

```sh
agentstack add skill-claude-world-claude-agent-image-gen
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Image Gen

Generate images from text prompts using the OpenAI Images API (DALL-E 3) via `curl`.
Requires an `OPENAI_API_KEY` environment variable.

## Prerequisites

No CLI install needed — uses `curl` and `jq` (pre-installed on macOS/Linux).

**Set up your API key:**
```bash
export OPENAI_API_KEY="sk-..."
# Or add to ~/.zshrc / ~/.bashrc for persistence
```

Get a key: https://platform.openai.com/api-keys

## Commands

**Generate a single image (returns URL):**
```bash
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 lake at sunset, photorealistic",
    "n": 1,
    "size": "1024x1024",
    "quality": "standard"
  }' | jq -r '.data[0].url'
```

**Generate HD image:**
```bash
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":"","n":1,"size":"1024x1024","quality":"hd"}' \
  | jq -r '.data[0].url'
```

**Download generated image to file:**
```bash
URL=$(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":"","n":1,"size":"1024x1024","quality":"standard"}' \
  | jq -r '.data[0].url')
curl -s "$URL" -o workspace/image-output.png
```

**Batch generate (loop):**
```bash
PROMPTS=("prompt one" "prompt two" "prompt three")
for i in "${!PROMPTS[@]}"; do
  URL=$(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\":\"${PROMPTS[$i]}\",\"n\":1,\"size\":\"1024x1024\",\"quality\":\"standard\"}" \
    | jq -r '.data[0].url')
  curl -s "$URL" -o "workspace/image-$i.png"
  echo "Saved workspace/image-$i.png"
done
```

## Size Options

| Size | Use Case |
|------|----------|
| `1024x1024` | Square (default, social media) |
| `1792x1024` | Landscape (banners, thumbnails) |
| `1024x1792` | Portrait (stories, posters) |

## Usage Examples

**Generate a social media card image:**
```bash
# Prompt + download to workspace
URL=$(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":"Minimalist tech blog cover, dark background, glowing circuit pattern, 1080x1080","n":1,"size":"1024x1024","quality":"hd"}' \
  | jq -r '.data[0].url')
curl -s "$URL" -o workspace/social-card.png
```

## Rules

- Always check that `OPENAI_API_KEY` is set: `[[ -z "$OPENAI_API_KEY" ]] && echo "OPENAI_API_KEY not set"`
- Never print the API key value in output
- Default to `dall-e-3`, size `1024x1024`, quality `standard` unless specified
- Always download images to `workspace/` directory; never just return raw URLs
- Name output files descriptively: `workspace/image-.png`
- For batch jobs, generate one at a time sequentially to avoid rate limits
- Check API response for errors: `jq '.error'` before using the URL
- Confirm completion with: "Generated  image(s) → workspace/"
- DALL-E 3 limit is n=1 per request; for multiple images, loop the request

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [claude-world](https://github.com/claude-world)
- **Source:** [claude-world/claude-agent](https://github.com/claude-world/claude-agent)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-claude-world-claude-agent-image-gen
- Seller: https://agentstack.voostack.com/s/claude-world
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
