{"id":"7f6c8b7a-bf67-4019-bcea-38a41d1a8d05","slug":"agw","kind":"skill","name":"agw","summary":"Use ChatGPT/Codex subscription models inside Claude Code while preserving the native Claude login.","owner":"JuLius5838","repoUrl":"https://github.com/JuLius5838/agw","license":"Apache-2.0","licenseTier":"permissive","trust":"community","stars":3,"match":null,"fewStars":true,"format":"skill","createdAt":"2026-07-24T06:32:04.000Z","addedAt":"2026-10-21T17:49:00.736Z","logoUrl":"https://avatars.githubusercontent.com/u/57898231?v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["developer-tools"],"tags":["ai-agents","claude-code","codex","litellm","llm-gateway","model-routing"],"runtime":"python","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-26T02:46:08.941Z","sample":false,"url":"https://conduits.dev/tools/agw","language":"Python","transports":["stdio"],"install":{"pypi":"agent-gateway"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# Agent Gateway (`agw`)\n\n[![CI](https://github.com/JuLius5838/agw/actions/workflows/ci.yml/badge.svg)](https://github.com/JuLius5838/agw/actions/workflows/ci.yml)\n[![Security](https://github.com/JuLius5838/agw/actions/workflows/security.yml/badge.svg)](https://github.com/JuLius5838/agw/actions/workflows/security.yml)\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)\n\nRoute Claude Code through a local hybrid gateway: native Claude requests keep the saved\nClaude subscription, while exact configured external names route to a private LiteLLM\nprocess on your machine.\n\n```text\n                         ┌▶ Anthropic (native Claude Code OAuth)\nclaude ─▶ AGW front router ─┤\n /model switches inside Claude └▶ private LiteLLM ─┬▶ ChatGPT/Codex\n                                                   └▶ GitHub Copilot\n```\n\nYou and Claude always name real models (for example `claude-opus-4-8`, `gpt-5.6-sol`);\nprovider prefixes such as `anthropic/`, `chatgpt/`, or `github_copilot/` remain private\nrouting configuration.\n\nAGW never mints, stores, or injects a second Anthropic token. Claude traffic is forwarded\nwith Claude Code's saved login; only external model selections enter LiteLLM.\n\n## Install\n\nAGW requires Claude Code, Python 3.12, and\n[`uv`](https://docs.astral.sh/uv/). Add the public marketplace and install the plugin:\n\n```bash\nclaude plugin marketplace add JuLius5838/agw\nclaude plugin install agent-gateway@agent-gateway\n```\n\nRestart Claude Code or run `/reload-plugins`, then invoke the bundled setup skill:\n\n```text\n/agent-gateway:gateway-setup\n```\n\nThe skill runs the bundled bootstrap, which installs the pinned `agw` runtime with `uv`\nand starts `agw setup`. To run the bootstrap directly from a local checkout instead:\n\n```bash\ngit clone https://github.com/JuLius5838/agw.git\ncd agw\nbash ./scripts/bootstrap.sh\n```\n\nExternal routes ship disabled. Setup remains native-Claude-only until you explicitly enable\nand authenticate an exact model/provider pair.\n\n## Daily use\n\n```bash\nagw setup                         # install local state and configure external models\nagw setup --provider-owner gpt-5.6-sol=chatgpt  # enable this exact external route\nagw setup --provider-owner gpt-4.1=copilot      # or an exact Copilot route\nagw auth chatgpt                  # ChatGPT/Codex OAuth device flow (needs a TTY)\nagw auth copilot                 # GitHub Copilot OAuth device flow (needs a TTY)\nclaude                            # managed workflow after setup\nagw claude                        # canonical/debug spelling\nagw claude --model gpt-5.6-sol    # launch on a specific model\nagw models list                   # show configured models\nagw usage                         # Claude + Codex limits and activity in one view\nagw doctor                        # diagnose problems (secrets redacted)\n```\n\nInside a session: `/model gpt-5.6-sol` switches to Codex, `/model claude-opus-4-8` back,\nand `/effort` controls either provider using Claude Code's native selector.\nSet `default_effort: max` in `~/.config/agent-gateway/config.yaml` for an overridable\nstartup default; an explicit `--effort` or an in-session `/effort` still wins.\nExternal candidates ship disabled so a fresh install stays native-only; enable only the\nmodel/provider pairs approved for the repository and data you are working with.\n\nInside Claude Code, `/agw-usage` opens the same unified dashboard as a native interactive\ndialog. A deterministic plugin hook invokes the local AGW MCP tool and blocks command\nexpansion before it reaches a model, so opening or refreshing the dashboard consumes no\nClaude or external-model tokens. A parallel fail-closed guard blocks expansion even if\nthe MCP server is still connecting and uses a same-terminal fallback instead. AGW\ninstalls the command registration as a\nstandalone user skill so it has the short command name instead of a plugin namespace.\nClaude's documented five-hour/seven-day limits are captured locally after each response;\nCodex limits, reset credits, and token activity are read live through Codex App Server\nusing the existing `agw auth chatgpt` credential. The credential bridge is capability-\nand version-gated to the tested Codex CLI `0.145.x` series. `agw setup` also pins\nthat executable's canonical path and SHA-256 before AGW may share an OAuth token\nwith its App Server; rerun setup after a reviewed Codex upgrade. Native `/usage`\nremains unchanged.\n\nClaude Code 2.1.218 only performs multi-model gateway discovery when a gateway credential\nreplaces the saved Claude login. AGW does not make that tradeoff: it adds one exact external\nname (the configured default, or first active name) to the visual picker through Claude's\nsupported custom-model option. Other active names remain selectable with `/model NAME`,\n`claude --model NAME`, and per-agent model assignment.\n\n```text\nagw claude ...    # canonical: always uses the managed gateway\nclaude ...        # same, after setup or `agw shell enable`\ncommand claude    # always bypasses the gateway → native Claude Code\n```\n\nAsk Claude in natural language to route work to a model:\n\n```text\nSpawn a review subagent using gpt-5.6-sol for this change.\nCreate two teammates: use gpt-5.6-sol for implementation and <other-model> for review.\n```\n\n## Safety model (summary)\n\n- The proxy binds only to `127.0.0.1` and requires a locally generated key.\n- OAuth credentials and the proxy key are per developer, `0600`, and never committed.\n- The gateway never falls back to a different model or load-balances across subscriptions.\n- The pinned LiteLLM runner routes ChatGPT through its Responses adapter so Claude's system\n  prompt becomes `instructions`, not a rejected `system` message.\n- GitHub Copilot uses LiteLLM 1.93.0's `github_copilot` adapter and a credential directory\n  isolated from ChatGPT. The packaged `gpt-4.1` candidate is disabled until explicitly\n  enabled, authenticated, and live-verified for the user's Copilot subscription.\n- Claude Code effort values reach GPT-5.6 as `reasoning.effort` without silently\n  downgrading `xhigh` or `max`.\n- Claude's hosted web-search declaration becomes Claude Code's client-side\n  `WebSearch` function for ChatGPT subscription models, avoiding the unsupported\n  `web_search_preview` backend type.\n- Prompts/tool schemas go to the selected upstream under that provider's data policy.\n\nSee [`docs/`](docs/) for architecture, security/threat-model, operations, model selection,\nthe compatibility report, and the policy decision. Full command reference:\n[`docs/operations.md`](docs/operations.md).\n\n## Project status\n\nAGW is an independent personal open-source project maintained by\n[Julien Fresnel](https://github.com/JuLius5838). It is not affiliated with or endorsed by\nAnthropic, OpenAI, GitHub, or LiteLLM. Anthropic does not support routing Claude Code to\nnon-Claude models; external-provider support is therefore compatibility-gated and may break\nwhen upstream clients or provider adapters change.\n\nThe automated suite covers the offline routing and security contracts. Real-subscription\nchecks listed in [`docs/compatibility-report.md`](docs/compatibility-report.md) remain the\nrelease gate for provider-backed claims. Use each provider only if its account terms and\ndata policy permit your intended workflow.\n\n## Contributing and security\n\nContributions are welcome under the [Apache License 2.0](LICENSE). Read\n[`CONTRIBUTING.md`](CONTRIBUTING.md) before opening a pull request. Report suspected\nvulnerabilities privately through [GitHub Security Advisories](https://github.com/JuLius5838/agw/security/advisories/new),\nnot a public issue; see [`SECURITY.md`](SECURITY.md).\n\n## Development\n\n```bash\nuv sync --all-groups\nuv run pytest -m \"not live\"   # offline unit, integration, and native-router contracts\nuv run ruff check . && uv run mypy src tests\n```\n\nRequires Python 3.12, `uv`, and (for unified Codex usage) Codex CLI `0.145.x`. Live smoke\ntests also require real provider subscriptions.\nMVP supports macOS and Linux with zsh or bash.\n"}