clirelay-imagegen

Generate raster images through the CliRelay OpenAI-compatible image endpoint and save them locally.

4|Updated Jun 2, 2026
One-click install
npx skills add https://github.com/sukbearai/king-ai --skill clirelay-imagegen-sukbearai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: clirelay-imagegen
Source: https://github.com/sukbearai/king-ai/tree/main/packages/skills/skills/clirelay-imagegen
Command: npx skills add https://github.com/sukbearai/king-ai --skill clirelay-imagegen-sukbearai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? It lets you generate images through a self-hosted CliRelay OpenAI-compatible image endpoint (gpt-image-2) when the default system image generation is unavailable or you explicitly want to route requests through your own configured service. ## Core Features & Use Cases - Custom Endpoint Image Generation: Calls a configured CliRelay /v1/images/generations endpoint with gpt-image-2, supporting size, quality, and model overrides. - Credential and Transport Safety: Reads CLIRELAY_API_KEY only from the environment, never logs or persists it, redacts it from error output, and requires an explicit --allow-insecure-http acknowledgement before using the plain HTTP endpoint. - Safe File Output: Refuses to overwrite existing files, validates the returned PNG/JPEG/GIF/WebP format against the file extension, and writes images atomically with 0600 permissions. - Use Case: You have a CliRelay relay with image quota and want a blog illustration saved to a specific path; run a dry-run to validate the prompt, then generate one 1024x1024 high-quality image. ## Quick Start Use the clirelay-imagegen skill to generate a 1024x1024 image from my prompt and save it to a new local PNG file.

Frequently Asked Questions about clirelay-imagegen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate an image with the CliRelay image endpoint?▼

Write your prompt to a private temporary file, then run scripts/generate.mjs with --allow-insecure-http, --prompt-file, and --output pointing to a new file path. The script reads CLIRELAY_API_KEY from the environment and saves the returned image atomically.

What image sizes and quality does gpt-image-2 support here?▼

The script defaults to 1024x1024 at high quality and accepts any WIDTHxHEIGHT between 1 and 4096 pixels via --size, plus a custom --quality value. Model can be overridden with --model, defaulting to gpt-image-2.

Is it safe to send my API key over the CliRelay HTTP endpoint?▼

The endpoint uses plain HTTP, so the bearer token and prompt are not encrypted in transit. The script requires an explicit --allow-insecure-http flag, never prints or persists the key, and redacts it from any API error output.

Why does the script refuse to generate an image?▼

Common causes include a missing CLIRELAY_API_KEY environment variable, an output file that already exists, an empty or oversized prompt file, or omitting --allow-insecure-http. Run with --dry-run first to validate inputs without a network call.

When should I use this instead of the default image generation skill?▼

Use it only when you explicitly want the CliRelay custom service, for example to consume quota on your own relay. For ordinary image requests that do not require CliRelay, the system image-generation skill is preferred.