copilot-api: Skill for Claude Code

.agents/skills/copilot-api-imagegen/SKILL.md

copilot-api-imagegen is a skill for Claude Code, Codex from caozhiyuan/copilot-api. It costs 155 tokens per session (2,529 once invoked), scanned A, original, MIT.

An image-generation and editing tool for creating raster images, which are pixel-based pictures, and animated GIFs through an online image service.

In plain words
What is it for?
Use it for illustrations, product images, banners, mockups, sprites, GIFs, and edits such as inpainting, compositing, lighting changes, or background replacement.
Why use it?
It lets an agent create or alter visual assets without setting up a separate image-processing program or software library. It supports targeted edits such as removing objects or replacing backgrounds.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents); mentions Codex.

This is caozhiyuan/copilot-api's own configuration. It tells Claude Code and Codex how to work on copilot-api itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything copilot-api configures →

About the project

caozhiyuan/copilot-api is a local AI gateway that exposes OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages interfaces for multiple providers. It lets clients such as Claude Code, OpenCode, and Codex connect through one endpoint to GitHub Copilot, the built-in Codex provider, and other configured services.

caozhiyuan/copilot-api · 1,136 stars · on GitHub · caozhiyuan.github.io

Reuse

Borrowing it

Nothing to install: this file belongs to caozhiyuan/copilot-api. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/caozhiyuan/copilot-api/dev/.agents/skills/copilot-api-imagegen/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/caozhiyuan/copilot-api

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for copilot-api-imagegen

README.md
[![agentmods](https://agentmods.dev/badge/skills/caozhiyuan/copilot-api/copilot-api-imagegen/github.svg)](https://agentmods.dev/skills/caozhiyuan/copilot-api/copilot-api-imagegen)
Your own site
<a href="https://agentmods.dev/skills/caozhiyuan/copilot-api/copilot-api-imagegen"><img src="https://agentmods.dev/badge/skills/caozhiyuan/copilot-api/copilot-api-imagegen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for copilot-api-imagegen

Your own site · 80×15
<a href="https://agentmods.dev/skills/caozhiyuan/copilot-api/copilot-api-imagegen"><img src="https://agentmods.dev/badge/skills/caozhiyuan/copilot-api/copilot-api-imagegen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 155 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,529 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00155 $0.02529
Opus 5.5 $0.00062 $0.01012
Sonnet 5.5 $0.00031 $0.00506
Haiku 4.5 $0.00015 $0.00253

Measured 3d ago against content hash 3785841094bb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

copilot-api-imagegen scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/image_gen.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/copilot-api-imagegen/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Copilot API Image Generation & Editing Skill

Generate and edit raster images through a running copilot-api gateway using the bundled zero-dependency Node.js/Bun CLI (scripts/image_gen.mjs).

No Python environment or openai SDK installation is required; the script runs directly on Node.js 20+ or Bun and works across all image providers supported by copilot-api (Codex, GitHub Copilot, xAI, and configured custom providers).

When to use

  • Generate a new raster image (concept art, product photo, hero banner, illustration, infographic, sprite, mockup)
  • Generate an animated GIF (--output-format gif) via Codex gpt-image-2
  • Edit an existing local image or image URL (inpainting, lighting/weather shifts, background replacement, object removal, compositing, style transfer, mask-guided edits)
  • Produce multiple variants (--n) or many distinct assets concurrently (generate-batch JSONL)

When not to use

  • Extending or editing an existing SVG/vector icon set, logo system, or code-native asset inside the repo
  • Creating simple diagrams, charts, or UI elements better authored in SVG, Mermaid, or HTML/CSS
  • Pure image inspection/analysis without creating or modifying an image file

Quick start

Resolve <SKILL_DIR> relative to this SKILL.md (in this repository: .agents/skills/copilot-api-imagegen):

export IMAGE_GEN=".agents/skills/copilot-api-imagegen/scripts/image_gen.mjs"

Dry-run first to inspect the resolved gateway URL, redacted auth status, default temp output path, and payload:

node "$IMAGE_GEN" generate \
  --prompt "A minimal hero image of a matte ceramic coffee mug on warm stone" \
  --size 1536x1024 \
  --dry-run

Decision tree

Evaluate three questions before running:

  1. Intent (generate vs edit):
    • Modifying an existing image while preserving parts of it -> edit
    • Creating a brand-new image (no input image) -> generate
    • Note: If the user supplies reference images for style/subject guidance, pass them via edit (--image, repeatable) and describe each image's role by index in the prompt.
  2. Execution strategy (single vs variants vs batch):
    • One prompt, one output -> generate (or edit)
    • One prompt, multiple variations -> --n 2..4
    • Many distinct assets/prompts -> generate-batch --input <temp-dir>/prompts.jsonl (omit --out-dir to write to a unique directory under <os.tmpdir()>/copilot-api-imagegen/, or pass --out-dir <path> when saving into a target workspace directory; do not misuse --n for unrelated assets)
  3. Provider & model selection:
    • Default (--model gpt-image-2 or --auto-model): copilot-api applies modelMappings first, then automatically picks the first available provider in order:
      1. Codex (gpt-image-2)
      2. GitHub Copilot (gpt-image-2.5-flare)
      3. xAI (grok-imagine-image-2.0)
    • Explicit provider/model pinning: pass --model codex/gpt-image-2, --model codex/gpt-image-1.5, --model github-copilot/gpt-image-2.5-flare, --model xai/grok-imagine-image-2.0, or --provider <name>.

Read the full file on GitHub · 150 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 150 lines · 155 tokens per session scan A 3785841094bb

Subscribe to this mod's changes

copilot-api-imagegen is a skill published in the GitHub repository caozhiyuan/copilot-api (1,136 stars, last pushed yesterday), licensed MIT. It adds 155 tokens to every session and 2,529 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-27.

Related

copilot-api-imagegen compared with skills from other repositories

copilot-api-imagegen next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
copilot-api-imagegencaozhiyuan/copilot-apiSkill1.1kyesterdayMITA155Claude Code, Codex
zenrouter-videoZenRouter/ZenRouterSkill51mo agoMITA73Claude Code, Codex
zenrouter-web-searchZenRouter/ZenRouterSkill51mo agoMITA73Claude Code, Codex
zenrouter-imageZenRouter/ZenRouterSkill51mo agoMITA73Claude Code, Codex
zenrouterZenRouter/ZenRouterSkill51mo agoMITA82Claude Code, Codex
zenrouter-embeddingsZenRouter/ZenRouterSkill51mo agoMITA65Claude Code, Codex
zenrouter-web-fetchZenRouter/ZenRouterSkill51mo agoMITA62Claude Code, Codex