rexai-image-generation
Installation
SKILL.md
RexAI Image Generation
Use RexAI's async image API to create images and return usable local files.
Quick Workflow
- Use
REXAI_API_KEYfor authentication. If it is missing, teach the user how to configure it for their platform before running the job. Read it live from the OS on Windows (powershell [Environment]::GetEnvironmentVariable('REXAI_API_KEY','Machine')) — a bash/PowerShell session started before the key was set holds a stale snapshot. - Choose the product ID (verify against the current instance's product list with one probe; these IDs have drifted before):
- Text-to-image:
gpt-image-2. - Image-to-image: the same
gpt-image-2product with the-Imageparameter — the relay selects the image-to-image route when the body carriesimages.gpt-image-2-i2idoes NOT exist (404 image_product_not_found); do not use it.
- Text-to-image:
- Pick the executor — prefer Python on every platform (the shell script's silent poll loop reads as a hang):
- Any platform with python3 (default choice): use
scripts/impl/rexai-image.py; stdlib only. It prints live poll progress every poll (agents can watch it run), reports the job id on submit/timeout, auto-resubmits on relay circuit-breaker/429 failures (bounded to 3 attempts), tolerates transient 5xx/network errors during polling, and always exits within the per-job--timeout(default 600s) — it cannot hang. If the agent's shell tool has its own timeout, pass a matching--timeoutso the script self-reports the job id instead of being killed mid-poll. - Windows without Python: use
scripts/impl/rexai-image.ps1; it only needs built-in PowerShell/.NET. - macOS/Linux without Python: use
scripts/impl/rexai-image-macos.sh; it uses common system tools (bash,curl,perl,base64). Pass--timeout-ms 600000for large sizes.
- Any platform with python3 (default choice): use
- Use
scripts/impl/rexai-image.mjsonly when Node is already available. - Report the local file path, job id, source URL if present, and expiry time if present.
Read references/api.md when you need endpoint details, supported sizes, error codes, or examples.