Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

newapi-image skill

newapi-image is a Codex skill for generating images through a user-provided OpenAI-compatible New API gateway. It uses the synchronous Images API by default and includes a small Python helper that can call:

  • /v1/images/generations (default)
  • /v1/images/generations/async
  • Responses API with the image_generation tool (explicit legacy mode)

The skill is useful when you want Codex to test or use your own compatible gateway instead of Codex's built-in image generation tool.

Install

Copy the skill folder into your Codex skills directory:

Copy-Item -Recurse -LiteralPath .\newapi-image -Destination "$HOME\.codex\skills\newapi-image"

Restart Codex so the new skill metadata is discovered.

Configure

Put your API key in ~/.codex/auth.json:

{
  "NEWAPI_API_KEY": "your-api-key"
}

Optionally set a custom gateway base URL in ~/.codex/config.toml:

[model_providers.custom]
base_url = "https://your-gateway.example/v1"

The script also accepts command-line overrides:

python .\newapi-image\scripts\generate_image.py `
  --base-url "https://your-gateway.example/v1" `
  --model "gpt-image-2" `
  --prompt "a glass lucky cat on a futuristic desk, realistic photo" `
  --output ".\image.png"

The command sends POST https://your-gateway.example/v1/images/generations. Use --async-mode only when the gateway supports the async sidecar. The old Responses image path remains available only through --responses-mode.

Notes

Do not commit real API keys. The script reads credentials from Codex auth config or from the --api-key argument for temporary local testing.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages