keirouter-chat

keirouter-chat is a skill for Claude Code, Codex from mydisha/keirouter. It costs 62 tokens per session (1,131 once invoked), scanned A, original, MIT.

A service guide for sending chat requests and code-generation prompts through KeiRouter, an API gateway that accepts common OpenAI and Anthropic request formats. It supports streaming responses and automatic fallback between configured providers.

In plain words
What is it for?
Asking an AI model questions, generating code, summarising text, streaming responses, and calling KeiRouter from curl or the OpenAI JavaScript SDK.
Why use it?
It lets applications use one endpoint and request format while selecting models or fallback combinations behind the gateway.

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-chat
Any agent
npx skills add mydisha/keirouter --skill keirouter-chat
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-chat

README.md
[![agentmods](https://agentmods.dev/badge/skills/mydisha/keirouter/keirouter-chat.svg)](https://agentmods.dev/skills/mydisha/keirouter/keirouter-chat)
Your own site
<a href="https://agentmods.dev/skills/mydisha/keirouter/keirouter-chat"><img src="https://agentmods.dev/badge/skills/mydisha/keirouter/keirouter-chat.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,131 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.00062 $0.01131
Opus 5 $0.00031 $0.00566
Sonnet 5 $0.00012 $0.00226
Haiku 4.5 $0.00006 $0.00113

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

Security

Grade A, and why

keirouter-chat 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 | jq '.data[].id'
skills/keirouter-chat/SKILL.md · 91 lines

How it starts

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

KeiRouter — Chat

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

Endpoints

  • POST $KEIROUTER_URL/v1/chat/completions — OpenAI format
  • POST $KEIROUTER_URL/v1/messages — Anthropic format
  • POST $KEIROUTER_URL/v1/responses — OpenAI Responses format

Discover

curl $KEIROUTER_URL/v1/models | jq '.data[].id'
# Per-model metadata (contextWindow, params)
curl "$KEIROUTER_URL/v1/models/info?id=openai/gpt-4o"

Combos (e.g. vip, mycodex) auto-fallback through multiple providers.

OpenAI format

curl -X POST $KEIROUTER_URL/v1/chat/completions \
  -H "Authorization: Bearer $KEIROUTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-5","messages":[{"role":"user","content":"Hi"}],"stream":false}'

JS (OpenAI SDK):

import OpenAI from "openai";
const client = new OpenAI({ baseURL: `${process.env.KEIROUTER_URL}/v1`, apiKey: process.env.KEIROUTER_KEY });
const res = await client.chat.completions.create({
  model: "openai/gpt-5",
  messages: [{ role: "user", content: "Hi" }],
  stream: true,
});
for await (const chunk of res) process.stdout.write(chunk.choices[0]?.delta?.content || "");

Anthropic format

curl -X POST $KEIROUTER_URL/v1/messages \
  -H "Authorization: Bearer $KEIROUTER_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"anthropic/claude-opus-4-7","max_tokens":1024,"messages":[{"role":"user","content":"Hi"}]}'

Response shape

OpenAI (/v1/chat/completions):

{ "id": "chatcmpl-...", "object": "chat.completion", "model": "openai/gpt-5",
  "choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello!" }, "finish_reason": "stop" }],
  "usage": { "prompt_tokens": 8, "completion_tokens": 2, "total_tokens": 10 } }

Streaming (stream:true) emits SSE: data: {choices:[{delta:{content:"..."}}]}\n\n ... data: [DONE]\n\n.

Read the full file on GitHub · 91 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 · 91 lines · 62 tokens per session scan A c09507dd5735

Subscribe to this mod's changes

keirouter-chat is a skill published in the GitHub repository mydisha/keirouter (129 stars, last pushed 7d ago), licensed MIT. It adds 62 tokens to every session and 1,131 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

omni-compression

Configure RTK (command output), Caveman (prose), and stacked compression modes. Manage language packs, custom rules, and test prompt compression reducing tokens by 60–90%.

diegosouzapw/OmniRoute · 42 tokens

cli-compression

Configure and test prompt compression from the CLI. Manage RTK filters, Caveman rules, stacked compression modes, and preview compression output with real prompts.

diegosouzapw/OmniRoute · 34 tokens

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

unified-ai-gateway

Operate and evaluate Unified AI System through twelve governed MCP tools, including provider-free prompt enhancement, while preserving fake-provider, authorization, and evidence boundaries.

happy520ai/unified-ai-system · 35 tokens