keirouter-image

keirouter-image is a skill for Claude Code, Codex from mydisha/keirouter. It costs 68 tokens per session (838 once invoked), scanned A, original, MIT.

An image-generation tool that sends a text description to KeiRouter and returns an image from supported image models.

In plain words
What is it for?
Use it to create pictures, illustrations, or other text-to-image outputs, with options such as image size, quality, count, and response format.
Why use it?
It gives an application one interface for creating images through different providers, instead of integrating each image service separately.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mydisha/keirouter/keirouter-image
Any agent
npx skills add mydisha/keirouter --skill keirouter-image
Clone the repo
git clone --depth 1 https://github.com/mydisha/keirouter

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 keirouter-image

README.md
[![agentmods](https://agentmods.dev/badge/skills/mydisha/keirouter/keirouter-image.svg)](https://agentmods.dev/skills/mydisha/keirouter/keirouter-image)
Your own site
<a href="https://agentmods.dev/skills/mydisha/keirouter/keirouter-image"><img src="https://agentmods.dev/badge/skills/mydisha/keirouter/keirouter-image.svg" alt="Measured on agentmods" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 838 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00068 $0.00838
Opus 5 $0.00034 $0.00419
Sonnet 5 $0.00014 $0.00168
Haiku 4.5 $0.00007 $0.00084

Measured 5d ago against content hash 0f97ca0e18b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

keirouter-image scanned grade A with 1 finding 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 5d ago.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl $KEIROUTER_URL/v1/models/image | jq '.data[].id'
skills/keirouter-image/SKILL.md · 82 lines

How it starts

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

KeiRouter — Image Generation

Requires KEIROUTER_URL (and KEIROUTER_KEY if auth enabled). See https://raw.githubusercontent.com/mydisha/keirouter/main/skills/keirouter/SKILL.md for setup.

Discover

curl $KEIROUTER_URL/v1/models/image | jq '.data[].id'
# Per-model params/options (size enum, quality enum)
curl "$KEIROUTER_URL/v1/models/info?id=openai/dall-e-3"

Endpoint

POST $KEIROUTER_URL/v1/images/generations

Field Required Notes
model yes from /v1/models/image
prompt yes image description
n no count (provider-dependent)
size no 1024x1024, 1792x1024, ...
quality no standard / hd (OpenAI)
response_format no url (default) or b64_json

Add query ?response_format=binary to receive raw image bytes (handy for saving file).

Examples

Save to file (binary):

curl -X POST "$KEIROUTER_URL/v1/images/generations?response_format=binary" \
  -H "Authorization: Bearer $KEIROUTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gemini/gemini-3-pro-image-preview","prompt":"watercolor mountains at sunrise","size":"1024x1024"}' \
  --output out.png

JS (URL response):

const r = await fetch(`${process.env.KEIROUTER_URL}/v1/images/generations`, {
  method: "POST",
  headers: { "Authorization": `Bearer ${process.env.KEIROUTER_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ model: "gemini/gemini-3-pro-image-preview", prompt: "neon city", size: "1024x1024" }),
});
const { data } = await r.json();
console.log(data[0].url || data[0].b64_json.slice(0, 40));

Response shape

JSON (default response_format=url):

{ "created": 1735000000, "data": [{ "url": "https://..." }] }

response_format=b64_json:

{ "created": 1735000000, "data": [{ "b64_json": "iVBORw0KGgo..." }] }

Query ?response_format=binary returns raw image bytes (Content-Type image/png or image/jpeg).

Provider quick reference

Read the full file on GitHub · 82 lines

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. 5d ago First seen · 82 lines · 68 tokens per session scan A 0f97ca0e18b1

Subscribe to this mod's changes

keirouter-image is a skill published in the GitHub repository mydisha/keirouter (129 stars, last pushed 8d ago), licensed MIT. It adds 68 tokens to every session and 838 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

10router-add-provider

Self-serve adding a custom OpenAI/Anthropic-compatible upstream provider (baseUrl + its own API key + models) to a running 10Router — no source change, no repackage, live immediately. Use when the user wants to register a self-hosted gateway / sk-xxx / baseUrl as a routable node, or an agent needs to add a custom…

techysy/10router · 87 tokens

10router

Entry point for 10Router — local/remote AI gateway with OpenAI-compatible REST for chat, image, TTS, embeddings, web search, web fetch. Use when the user mentions 10Router, TENROUTERURL, or wants AI without writing provider boilerplate. This skill covers setup + indexes capability skills; fetch the relevant capability…

techysy/10router · 83 tokens

10router-chat

Chat / code generation via 10Router using OpenAI /v1/chat/completions or Anthropic /v1/messages format with streaming + auto-fallback combos. Use when the user wants to ask an LLM, generate code, summarize text, or run prompts through 10Router.

techysy/10router · 63 tokens

10router-dev

Develop / troubleshoot 10Router on NAS. Use when debugging why a client or model 'doesn't work' through the gateway, deploying to NAS, or deciding whether to fix or work around a third-party bug. 10Router 开发排障:排查客户端/模型经网关报错、部署 NAS、判断是否适配第三方 bug。.

techysy/10router · 77 tokens

10router-image

Generate images via 10Router /v1/images/generations using OpenAI / Gemini Imagen / DALL-E / FLUX / MiniMax / SDWebUI / ComfyUI / Codex models. Use when the user wants to create, generate, draw, or render an image, picture, or text-to-image (txt2img).

techysy/10router · 74 tokens

10router-web-fetch

Fetch URL → markdown / text / HTML via 10Router /v1/web/fetch using Firecrawl / Jina Reader / Tavily Extract / Exa Contents. Use when the user wants to scrape a webpage, extract URL content, read article, or convert a URL to markdown.

techysy/10router · 63 tokens