openrouter-images — Claude Code skill: image generation and editing via OpenRouter
This skill talks to OpenRouter's Image API to draw from a text prompt or rework an existing picture with instructions. It also lists which models exist and what they accept.
npx skills add OpenRouterTeam/skills --skill openrouter-images -a claude-codeWhat openrouter-images does
Two TypeScript scripts do the work. generate.ts posts your prompt to /api/v1/images and writes the result to disk. edit.ts takes a local file, sends it as an image-to-image reference, and applies whatever change you described. A third script, discover.ts, prints the available image models with their parameters.
Models differ in what they accept, so guessing flags gets you a 400. Run npx tsx discover.ts <model> first: it reports allowed values per provider endpoint, including passthrough keys usable in --provider-options. Editing has its own condition: only a model whose input_modalities include image can take a source picture.
Set OPENROUTER_API_KEY in your environment before generating or editing; keys are issued at openrouter.ai/keys. Then run npm install inside the skill's scripts folder. Discovery works without a key, which is handy for picking a model. generate.ts and edit.ts share flags like --model, --aspect-ratio, --resolution, --output-format and --n.
Editable inputs: .png, .jpg, .jpeg, .webp, .gif. Unless you name another model, calls go to google/gemini-3.1-flash-image-preview. The script prints the USD cost to stderr whenever the API reports it.
What it helps with
- produce an illustration from a written description
- change the sky or style in an existing photo
- check which image models exist and what each one accepts
- get a wide image at a given aspect ratio
- save several variants from a single request
Example prompts for the agent
- Generate a wide sunset over mountains at 16:9
- Make the sky purple in
photo.png - Which models support a 4K resolution?
How to install openrouter-images
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-images -a claude-code2Manually: put the files in place
~/.claude/skills/openrouter-images/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/openrouter-images/
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-images -a codex2Manually: put the files in place
.agents/skills/openrouter-images/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-images -a cursor2Manually: put the files in place
.cursor/skills/openrouter-images/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install OpenRouterTeam/skills openrouter-images2Manually: put the files in place
.github/skills/openrouter-images/SKILL.md1Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-images -a gemini-cli2Platform CLI
gemini skills install https://github.com/OpenRouterTeam/skills --path skills/openrouter-imagesManually: put the files in place
.devin/skills/openrouter-images/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add OpenRouterTeam/skills --skill openrouter-images -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about openrouter-images
How do I install openrouter-images in Claude Code?
Run npx skills add OpenRouterTeam/skills --skill openrouter-images -a claude-code. The skill lands at ~/.claude/skills/openrouter-images/SKILL.md.
What does openrouter-images do?
It creates images from prompts and modifies existing ones through OpenRouter's Image API. A discovery script tells you which models and parameters are valid.
What do I need before using it?
An OPENROUTER_API_KEY environment variable and npm install in the skill's scripts directory. For editing, the chosen model must accept image input.