Use a Codex Skill to Generate Images
Install and use the GetToken ImageGen Skill for Codex image generation with GPT Image 2.5 models.
When using the GetToken relay service, Codex cannot generate images directly through the built-in client ImageGen.
Built-in ImageGen needs a key that can connect directly to the OpenAI Images API. GetToken provides a relay service API key, and that key does not take over the direct ImageGen path inside Codex.
Image generation with the GetToken relay service must use the gettoken-imagegen Skill.
Install It
Open the Stable Image API console, choose macOS or Windows, copy the one-line install command, run it, and restart Codex.
Already installed? Run the same command again to update to the latest version. Your config and task history are preserved. You can also let Codex run <skill>/bin/<platform>/gettoken-imagegen update.
Requirement
When generating images in Codex, image generation tasks must be handled by gettoken-imagegen.
Do not use:
- Built-in Codex ImageGen
- Image generation paths that depend on an official OpenAI direct key
Use:
gettoken-imagegenSkill- GetToken API Key
- OpenAI-compatible Images API endpoint
Configure the Endpoint
The installer writes the image API key and stable image endpoint into the skill configuration. Do not expose the API key in source code, screenshots, or public commands after installation.
Install Location
The Skill is installed under ~/.agents/skills/gettoken-imagegen. Run the install command on the same machine where Codex runs.
Troubleshooting
Why not use built-in ImageGen directly
Built-in Codex ImageGen requires a key that can connect directly to the OpenAI Images API. When using the GetToken relay service, that direct path does not work, so gettoken-imagegen must handle image generation.
Codex Cannot Find the Skill
Confirm the Skill is installed under ~/.agents/skills/gettoken-imagegen, then restart Codex.
Windows Installation Does Not Work
Confirm that you use the PowerShell install command on native Windows.
Generation Fails
Check:
- The image API key is configured.
- You can reach the stable image endpoint.
- The output directory exists and is writable.