---
title: "Claude Code Gateway: The Corporate LLM Gateway Between Coding Agents and Model Providers"
description: "Claude Code Gateway is the corporate LLM gateway I built and operate at Spotware: provider routing and failover across multiple AI labs, per-user request, token, and cost accounting at API prices, an authenticated admin surface with real-time analytics, and centrally administered usage governance — rebuilt from an open-source foundation into a corporate-grade service."
date: "2025-09-15T07:00:00Z"
last_updated: "2026-08-28"
build_time: "2026-08-28T03:11:43Z"
project_name: "Claude Code Gateway"
project_description: "The corporate LLM gateway between every engineer's coding agent and the upstream model providers: provider routing and failover across multiple AI labs, per-user request, token, and cost accounting at API prices, an authenticated admin surface with usage analytics, and centrally administered usage governance — rebuilt from an open-source foundation into a corporate-grade service."
status: "Active"
project_group: "enterprise-ai-platforms"
period_from: "2025-09-15"
client: "[Spotware Systems](https://www.spotware.com/)"
related_skills: ["artificial-intelligence","claude-code","product-management","system-analysis","quality-assurance","rest-api","databases","devops","docker","kubernetes"]
related_projects: ["mcp-gateway"]
related_experience: ["ai-product-manager-at-spotware"]
keywords: ["LLM Gateway","AI Gateway","API Proxy","Claude Code","Model Providers","Provider Routing","Failover","Rate Limits","Cost Accounting","Token Accounting","Usage Governance","AI Platform","TypeScript","Kubernetes","AI Product Management"]
license: "https://creativecommons.org/licenses/by/4.0/"
canonical: "https://www.alexfeel.info/projects/claude-code-gateway/"
---

## Overview

Claude Code Gateway is the corporate API gateway that sits between every engineer's coding agent and the upstream model providers at Spotware. Every request a coding agent makes to a frontier model passes through it: the gateway decides which provider serves it, accounts for what it cost and who spent it, and enforces the usage rules the organization has set — all without the client ever noticing there is a proxy in the path.

It began as a fork of an open-source Claude-compatible API proxy and was rebuilt into a corporate-grade service several times its original size. The open-source skeleton is still recognizable in a small minority of the code; virtually everything that makes it viable as a company-wide production service — the authentication system, the reliability semantics, the analytics, the governance — was built on top of it, and it has kept serving through a year of continuous upstream change: new contracts, new pricing, new rate limits, new frontier models.

## The Problem

Rolling out coding agents across an engineering organization creates problems no single developer's setup ever surfaces:

- **Rate limits stall real work.** A provider's rate limits are not sized for a whole engineering floor hitting the same models at once. Without coordination, one team's heavy afternoon blocks another team's release.
- **Costs are invisible at the point of spend.** When every laptop talks to a vendor directly, nobody can say what a team, a project, or a single request actually cost — and pricing that changes upstream changes it silently.
- **Governance has nowhere to live.** Which models may be used, and for what, is an organizational decision. Enforced on each developer's machine, it is not enforced at all.
- **Provider incidents become outages.** A model degradation or a capacity squeeze at one lab should be a routing decision, not a company-wide stoppage.

A single governed entrance solves all four — if it can carry production traffic without becoming the bottleneck or the failure point itself.

## The Solution

- **Provider routing and failover across multiple AI labs.** The gateway routes across multiple upstream providers, including leading Chinese AI labs, so a disruption at any one of them degrades to a reroute rather than an outage — and capacity decisions, like retiring a model that consumes disproportionate limits, are made once, centrally, instead of per laptop.
- **Per-user request, token, and cost accounting at API prices.** Every request is attributed to the person who made it, with token usage broken down to cache reads and cache creation, and cost computed against the original provider's own published, dated price schedule. A dimension the price list does not cover is reported as unavailable — never silently zeroed — so the economics of any usage model stay decidable from real numbers.
- **An authenticated admin surface.** The dashboard and its API sit behind a full authentication subsystem: session-based sign-in, automation tokens, brute-force lockouts with escalating throttling, and a persistent audit trail of administrative actions. Behind it: real-time analytics on cost, token consumption, request volume, response times, and per-model performance, plus an incident feed.
- **A versioned client contract.** An incompatible or outdated client gets a precise, actionable answer about what to do — instead of a cryptic failure that becomes a support thread.
- **Centrally administered usage governance.** Which models, providers, and usage patterns a request may reach is configured by administrators and enforced at the gateway, rather than left to each developer's machine.

## Under the Hood

- **Byte-level protocol fidelity.** Rather than normalizing many providers into one generic shape, the gateway is engineered around exact fidelity to one real client's wire contract — the Claude Code CLI. Streaming responses are re-framed byte-preservingly, provider-native error shapes are reproduced exactly, and signed model-output blocks pass through untouched, so the client cannot tell it is talking to a proxy. Fidelity at that level is what makes a transparent gateway actually transparent.
- **Fail-closed reliability semantics.** Capacity state is never guessed: a rate-limit response is only ever emitted from a verified signal the provider actually sent, and every uncertain state degrades to a safe, explicitly retryable response instead of a confident-looking fabrication. Auditability and correctness win over convenience, deliberately.
- **Built for large payloads.** Request bodies above a configurable size threshold run the request-transform pipeline in a dedicated worker-thread pool instead of the main event loop, so a handful of very large requests cannot make the gateway sluggish for everyone else.
- **Deliberately boring operations.** One server process over one embedded database, deployed on Kubernetes — in a cluster the AI platform function operates itself — with health and readiness probes, scheduled maintenance windows, and deploy-overlap guards: an architecture chosen for operability first, and proven by a steady cadence of production releases across the year.

## Depth over Breadth

General-purpose LLM gateways such as LiteLLM make a breadth-first bet: support the widest possible provider surface behind one normalized shape. This gateway makes the opposite bet — depth-first fidelity to the one client that matters, with reliability semantics strict enough to be trusted as the single path for all of an organization's coding-agent traffic. Both bets are legitimate; they solve different problems. When the requirement is that hundreds of daily agent sessions be indistinguishable from talking to the provider directly, while every request is accounted for and governed, protocol fidelity is the product.

## My Role

I own the gateway end to end: the decision to start from an open-source foundation rather than build from zero, the product judgment about what a corporate gateway must add to it, and nearly all of the code that did. I operate it as a production service — the capacity calls, the provider changes, the maintenance windows — and I run its roadmap the way the rest of my platform work runs: reliability first, economics visible, governance central. For the broader role context, see [AI Product Manager at Spotware](/experience/ai-product-manager-at-spotware/).


## Site index

- [llms.txt](https://www.alexfeel.info/llms.txt)
- [Complete index](https://www.alexfeel.info/llms-index.txt)
