GPT-image-2 Image Generation
GPT-image-2 is OpenAI's image generation model, supporting both text-to-image and image-to-image (editing, reference images). By installing an image-generation skill, AI agents like Claude Code and Codex can call the yylx.io API to generate images directly — no API code required.
[!TIP] Before you start, confirm in the console that your API Key supports the GPT-image-2 models. Examples in the docs use
sk-your-api-keyinstead of a real Key.
Available skills
The community currently offers several GPT-image-2 skills, for example:
| Skill | URL | Highlights |
|---|---|---|
| GPT-Image2-Skill | https://github.com/wuyoscar/GPT-Image2-Skill | Ships with a curated prompt library; installable from the Claude Code plugin marketplace |
| gpt-image-2-skill | https://github.com/wangnov/gpt-image-2-skill | Rust implementation; transparent-PNG extraction, local history, agent-friendly output |
Installation
No manual install commands needed — just tell the AI agent what to install and configure. In Claude Code (or another skill-capable agent), send:
Install this skill for me: https://github.com/wangnov/gpt-image-2-skill
Then configure it: custom Host https://app.yylx.io, API_KEY sk-your-api-key
If you prefer the other skill, swap the URL for https://github.com/wuyoscar/GPT-Image2-Skill.
The AI agent downloads and installs the skill, and writes the Host and API Key into the right configuration. Once done, ask it to repeat the current configuration back so you can confirm the Host and Key took effect.
[!WARNING] Replace
sk-your-api-keywith a real Key copied from the console's "API Keys" page. Never paste a Key into public repositories, group chats, or screenshots.
Generate images
Once installed and configured, just ask the AI agent in natural language. Naming the skill explicitly in the instruction helps the agent call the right one, for example:
Use gpt-image-2-skill to generate a studio product photo of a red apple, transparent background, saved as apple.png
You can also provide a reference image for editing:
Use gpt-image-2-skill with this logo.png as reference and make a dark-background version
Use the name of whichever skill you actually installed — if it's GPT-Image2-Skill, write that name in the instruction. Most agents also pick the skill automatically when the request is clearly about image generation, but naming it explicitly is more reliable.
Generated images are saved to the current directory or the path you specify.
Troubleshooting
| Problem | Fix |
|---|---|
| Authentication fails | Confirm the configured API Key matches the console and is still active |
| Connection fails | Confirm the Host is https://app.yylx.io, without any extra endpoint path |
| Model unavailable | Check in the console whether your current group supports the GPT-image-2 models |
| 429 rate limited | Too many generation requests in a short window — retry later or lower concurrency |
| Skill not taking effect | Restart the AI agent (e.g. reopen Claude Code) so the newly installed skill loads |
For API errors, see Common Errors for further diagnosis.