model-gateway

model-gateway is a skill for Claude Code, Codex from Eigenwise/eigenwise-toolshed. It costs 42 tokens per session (3,168 once invoked), scanned B, original, MIT.

A setup and diagnostic assistant for a local gateway that adds ChatGPT, Codex, and Grok models to Claude Code's model picker. A gateway is a local service that directs requests to different model providers.

In plain words
What is it for?
Setting up, updating, or troubleshooting the gateway used by Claude Code sessions and executor worktrees.
Why use it?
It helps configure model access, sign-in, routing, and model visibility without putting a machine-local endpoint in committed project files.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the model-gateway plugin — 3 skills shipped together

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/eigenwise/eigenwise-toolshed/model-gateway
Any agent
npx skills add Eigenwise/eigenwise-toolshed --skill model-gateway
Clone the repo
git clone --depth 1 https://github.com/Eigenwise/eigenwise-toolshed

Made for: Claude Code, Codex.

Or install model-gateway, the plugin that ships this one along with the rest of its 3 skills.

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 model-gateway

README.md
[![agentmods](https://agentmods.dev/badge/skills/eigenwise/eigenwise-toolshed/model-gateway.svg)](https://agentmods.dev/skills/eigenwise/eigenwise-toolshed/model-gateway)
Your own site
<a href="https://agentmods.dev/skills/eigenwise/eigenwise-toolshed/model-gateway"><img src="https://agentmods.dev/badge/skills/eigenwise/eigenwise-toolshed/model-gateway.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,168 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 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.00042 $0.03168
Opus 5 $0.00021 $0.01584
Sonnet 5 $0.00008 $0.00634
Haiku 4.5 $0.00004 $0.00317

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

Security

Grade B, and why

model-gateway scanned grade B 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 4d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`env --write-user` remains an opt-in shared fallback for people who deliberately want one gateway URL in `~/.claude/settings.json` across every project. Claude Code gives a current project's `settings.local.json` higher
plugins/model-gateway/skills/model-gateway/SKILL.md · 180 lines

How it starts

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

model-gateway

Two local processes give Claude Code native access to the user's ChatGPT subscription models: claude-code-proxy (does OpenAI OAuth and translates Anthropic Messages API to the Codex backend) and a shim router this plugin owns. ANTHROPIC_BASE_URL points at the shim: requests for claude-gpt-* models are un-prefixed and go to the proxy, everything else passes through to api.anthropic.com with the user's normal claude.ai login. The shim's /v1/models advertises Codex models with a claude- prefix because Claude Code's model discovery drops ids that don't start with claude/anthropic. That prefix is shared with the real Anthropic ids, so the route is decided by the backend family segment (claude-gpt-*, claude-grok-*), never by the prefix.

All commands: node "${CLAUDE_PLUGIN_ROOT}/bin/model-gateway.js" <command>

First-time setup

Project-local wiring is the standard setup. env --write-project writes the current project's .claude/settings.local.json, so the gateway stays configured for this project's sessions and executor worktrees without putting a machine-local endpoint in a committed file. setup uses the same project-local target.

env --write-user remains an opt-in shared fallback for people who deliberately want one gateway URL in ~/.claude/settings.json across every project. Claude Code gives a current project's settings.local.json higher precedence, so doctor marks the winner [effective], names both files, and says that project-local wiring wins when their gateway modes disagree.

The SessionStart hook injects a one-line nudge while the gateway is in any half-configured state; act on it. The user sees that same line in the transcript, because a state only they can fix used to reach the model alone. Anything routine stays out of it, and the hook always exits 0 so the line survives: run ensure yourself when you need an exit code. setup is one-shot and idempotent: it downloads the claude-code-proxy binary (sha256-verified) and starts everything. Re-running it later is also the upgrade path.

Read the full file on GitHub · 180 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. 4d ago First seen · 180 lines · 42 tokens per session scan B 133b0febe837

Subscribe to this mod's changes

model-gateway is a skill published in the GitHub repository Eigenwise/eigenwise-toolshed (37 stars, last pushed today), licensed MIT. It adds 42 tokens to every session and 3,168 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens