UNDERSTUDY

WHEN YOUR MODEL CAN'T GO ON,
THE SHOW DOES.

A self-hosted gateway that keeps your AI agents running when a model taps out. Rate limit, quota, outage: the understudy steps in mid-scene, and your agent never knows the lead changed.

NOW SHOWING
curl -fsSL https://understudy.cc/install.sh | bash

macOS / Linux, Node 20+ ยท Windows: npx github:ariangibson/understudy

That puts it on your machine. The first launch runs a short setup - provider keys, a fallback chain, and auto-wiring the agent tools you already use. After that, starting the gateway is one word.

PLACES, EVERYONE

RAISE THE CURTAIN

YOUR CUE
understudy

Point any agent at the understudy endpoint and it never gets interrupted mid-session again - no harness restart, no config change, no worries.

Take your seat.

Pixel-art robot taking a bow in a spotlight on a theater stage
ACT I

2 A.M. THE LEAD FORGETS ITS LINES.

Your agent is deep in an overnight run - the refactor is finally going somewhere. Then the 429. Without understudy, the curtain falls. With it:


      

Same session. Same tools. No restart. What your agent notices: nothing.

ACT II

THE QUICK CHANGE, IN TWO ENVIRONMENT VARIABLES.

One variable on the gateway, one on your harness. That is the entire wiring.

FALLBACK_CHAIN=openai/gpt-5.5 understudy        # the understudy waits in the wings
ANTHROPIC_BASE_URL=http://localhost:42986 claude  # business as usual - until it isn't
ACT III

THE SHOW THAT NEVER CLOSES.

Surviving one bad night is the easy part. Here is what makes understudy the gateway you leave running.

SEASON TICKETS

API keys aren't the only way to pay. understudy login seats a ChatGPT, Claude, or Copilot subscription you already own as a link in the chain - no per-token bill when it covers a run.

REHEARSALS ARE FREE

Identical requests replay from cache - streamed or not, ~0 ms, zero tokens billed. Crash-and-retry loops stop charging you twice for the same lines.

THE BOX OFFICE

Every request logged with tokens, latency, cost, and who served it. curl /v1/usage and finally know what the overnight run actually cost.

NO DRAMA OFFSTAGE

Strict TypeScript, four runtime dependencies, no database. Self-hosted, so your provider keys never leave the building.

DRAMATIS PERSONAE

THE CAST

THE COMPANY

in order of appearance

AnthropicClaude - Fable, Opus, Sonnet
OpenAIGPT-5.x
GoogleGemini 3.x
xAIGrok 4.x
GroqLlama 4, fast inference
DeepSeek / Mistralchat, reasoner, Codestral
Ollamaanything local, keyless
Syntheticopen weights - Kimi, GLM, Qwen
ChatGPT / Copilotyour subscription, via OAuth

โ˜… marks the lead. Recast any role by changing one string.

PLAYS WELL WITH

Claude Code Codex OpenCode OpenClaw Hermes Agent LangChain your own code

The five most popular harnesses have been 100% validated by the backstage crew. LangChain, other agents, and your own code will also work when connected to understudy through the standard OpenAI endpoint pattern.

STAGE MANAGEMENT

THE PROMPT BOOK

One binary runs the whole production. Here is the full set of cues.

CURTAIN CALL

TAKE A BOW

That's the show. If the understudy earned the part, leave a star on GitHub on your way out - the source is there too.