Subrouter banner
manaflow-ai manaflow-ai

Subrouter

Development community

Description

Subrouter routes Codex/Claude Code traffic across multiple ChatGPT Pro/Claude Max subscriptions and API keys.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Subrouter

Subrouter is a local AI coding-agent proxy. It routes traffic across Codex accounts with sticky conversation-to-account assignment so cached context stays useful.

Goals

  • Run fast on a Mac Mini.
  • Forward requests with normal Go reverse-proxy behavior, including headers and streaming responses.
  • Support subscription accounts first, API keys second.
  • Keep each conversation pinned to one account.
  • Pick a fresh account for a new conversation based on available rate-limit headroom.
  • Provide the Codex account manager and daemon in one Go binary.

Install

Keeping the CLI current on macOS

A shared server autoupdates its worker. A laptop does not, so clients drift behind the servers they talk to and hit failures nobody can reproduce. Install the per-user updater once:

curl -fsSL https://raw.githubusercontent.com/manaflow-ai/subrouter/main/deploy/macos/install-cli-autoupdate.sh | bash

It installs a LaunchAgent that checks daily, compares the release tag against `~/.subrouter/cli-version`, and exits without downloading when they match. Updates go through `install.sh`, so the release checksum is verified, and a missing binary forces a reinstall even when the marker looks current. Logs land in `~/Library/Logs/subrouter-cli-autoupdate.log`. Remove it with `launchctl bootout gui/$(id -u)/ai.manaflow.subrouter-cli-autoupdate`.

GCP setup prompt

Paste this into Claude, Codex, or another coding agent with GCP operator access and a local browser for OAuth:

Set up Subrouter as a shared production service.

Inputs:
- GCP project, zone, and instance:   
- Public server URL: https://sr.cmux.com
- Local server nickname: team

Rules:
- Do not copy ~/.codex/auth.json or local ~/.subrouter/codex/accounts/*.json to the server.
- Server OAuth accounts must be created with fresh server-owned login flows.
- Do not print access tokens, refresh tokens, API keys, id tokens, or admin tokens.
- Never use SSH, SCP, or