---
title: "How an AI gateway works for Claude Code and Codex · Selan"
description: "Add your accounts and keys, give your team one CLI, and Selan routes each Claude Code and Codex request to the right account, with spend limits per user."
url: https://selan.ai/how-it-works
updated: 2026-11-15T18:34:23+02:00
---

How it works

# One proxy between your team and the model

Add the accounts you already pay for, give your developers one command, and Selan sends every request to the account that should serve it.

01Insights

## Where did the time go?

-   Hours by repository, each bar split by the people who were in it, and the same hours read the other way, by person.
-   Context reuse per repository: how much came back out of the cache instead of being processed again.
-   Every duration is lease time: how long a credential was held, not time at a keyboard.
-   It records the repository, who ran the session, and what it cost. Never prompts, transcripts, tool names or files touched.

Repositories · split by person · 7 days

checkout-api111.4M

storefront79.6M

admin62.7M

mobile36.5M

Context reuse · per repository

Poor 0–49%Watch 50–74%Healthy 75–100%

checkout-apiHealthy85%

storefrontHealthy89%

adminHealthy90%

mobileWatch63%

Spend · 7 days

**$77.88**API costCharged per token, on this company's own API keys.

**$261.12**On subscription plansEquivalent value at API list price.

**77.0%**Absorbed by seatsShare of this window's list-price value the seats covered.

By credential

CClaude Max — engineering243M84%

KAPI key — overflow & CI47.2M ($77.88)16%

By member

MemberTokensShare

aava@example.com94.5M33%

lleo@example.com83.1M29%

mmaya@example.com66.9M23%

nnoah@example.com42.7M15%

02Spend

## Where did the money go?

-   What the window cost on your own API keys, and what the same traffic would have been at API list price.
-   The share of that list price your subscriptions absorbed: one number for whether the seats earn their keep. Where a seat breaks even against the API is [worked out here](https://selan.ai/guides/max-plan-vs-api-cost).
-   Every credential you brought in one bill, subscription seats beside API keys, read by model, by credential, by person.
-   Usage and Insights measure the window from the same rollup, so the two pages cannot disagree about it.

03Connections

## Verified connections, ready for work.

-   A catalog of connectors (GitHub, GitLab, Linear, Jira, Sentry, Notion, Figma, Stripe and [the rest](https://selan.ai/docs/mcp-connections)), each listed beside the official host it reaches.
-   A developer turns one on for Claude Desktop, for Claude CLI, or for both. Desktop starts on and the CLI starts off, so the one to switch is usually the CLI.
-   They sign in to it as themselves, so their own permissions apply and Selan never holds the account.
-   What the company allows is the owner’s call, under Settings → Manage.
-   With the [Browser Extension](https://selan.ai/docs/browser-extension), agents can also use your own Chrome, in one tab group and only on the sites you allow.

Verified connectors · official hosts

GGitLabgitlab.comConnected

LLinearmcp.linear.appConnected

SSentrymcp.sentry.devConnected

31 more tools your company has not connected

AAirtablemcp.airtable.comConnect

AAmplitudemcp.amplitude.comConnect

AAsanamcp.asana.comConnect

CCanvamcp.canva.comConnect

Marketplaces · on for the company

Anthropic officialAnthropic's own plugin directory.Added Aug 23, 2026 by ava@example.com

Knowledge workAnthropic's plugins for Cowork.Added Aug 23, 2026 by ava@example.com

acme-pluginsAdded by your company.Added Aug 23, 2026 by ava@example.com

Your own · checked before it saves

github.com/acme/pluginsAdd

04Plugins

## Where Claude looks for plugins.

-   A marketplace is a directory Claude checks for plugins: commands, agents and skills. Switch one on and its plugins appear for every developer’s Claude. Nothing installs on its own.
-   One switch by the owner covers the company, and the row records who pointed Claude at that repository, and when.
-   Distribution is automatic: Claude re-checks each marketplace, so a plugin added later reaches everyone without a single reconnect.
-   Your own marketplace is a public repo holding .claude-plugin/marketplace.json. It is fetched and checked before it saves, so a url that is not one is refused in the form, not on every developer’s machine.

05Settings

## The switches, and who may move them.

-   Secret scanning and repository recording sit under Privacy & data, and both ship off. Nothing is scanned or recorded until somebody decides.
-   Outage failover sits under Reliability: on a 529, requests go out on your own provider keys instead of stopping.
-   Every switch carries its last change: the day beside the row, who moved it on the hover.
-   Manage is the owner’s half: custom models, spend limits, API tokens and company connections. Doors to their own panels, not switches.

Privacy · reliability

Privacy & data

Secret scanningRedact credentials before a request reaches the model.23 Aug 15:12

InsightsRecord which repository each coding session ran in.23 Aug 09:31

Reliability

Fail over during an Anthropic outageOn a 529, send requests to your own provider keys instead.23 Aug 15:12

Manage · the owner’s half

ConnectionsTools your developers may connect Claude to.3 connectedManage connections

Custom modelsModels in your providers' catalogues, by id.None yetManage models

Spend limitsWhat one member may spend on API keys.4 members · 1 overSet user limits

CLI tokensFor where no browser can sign in.None yetManage tokens

Tokens · subscriptions and API keys

**Claude**any request · 5h 28% · 7d 80%

Credential5h7dLast served

Claude Max — engineeringPreferred12 min ago

Claude Max — platformWeekly limit · 2d 16h3 hr ago

**OpenAI**when named

ChatGPT Team34 min ago

**API keys**billed per token

OpenAI — evals4 days ago

OpenRouterCooling off · 35m1 hr ago

Anthropic — CIOver day budget2 hr ago

VertexPaused6 days ago

06Tokens

## Every credential in one list.

-   Subscriptions and API keys in the same table (Claude Max seats, a ChatGPT Team plan, OpenAI, Vertex and OpenRouter keys), grouped by what serves a request.
-   Subscription windows as meters: the 5-hour and 7-day share used, for each seat and for the group as one pool.
-   The reason a credential is out of rotation is in its row: at a weekly limit, cooling off after a 429, over a day budget, paused.
-   Every row ends with when it last served a request, so a credential that has gone quiet says for how long.
-   None of them is ever on a developer’s laptop: [what lands there instead](https://selan.ai/guides/claude-code-without-api-keys).

07Headroom

## What one credential has left.

-   Any credential opened: the 5-hour and 7-day windows as a share used, each with the clock to its reset.
-   Top models for the week, tokens and list price each: where the seat’s capacity actually went.
-   A subscription is priced as equivalent API cost, what the same traffic would have billed per token, so a seat can be compared to a key.
-   Spend by hour for the last day, and the row’s own facts (added when, by whom, last active) on the same panel.

One credential, opened · Claude Max — engineering

5-hour windowresets 20:03 — in 1h 37m34%

7-day windowresets 00:16 — in 3d 5h61%

Top models · 7 days

sonnet-5166.1M$160.61

opus-563.2M$96.60

haiku-4-513.7M$3.91

A Claude subscription account isn't billed per token: the figures above are the equivalent API cost, what the subscription is saving you.

Logs · newest first

RequestsSecrets 0

TimeSessionWhoModelPriceStatus

14:32:1897f31fb1lleosonnet-5$0.0331200

14:31:2897f31fb1lleohaiku-4-5$0.0108200

14:29:3997f31fb1lleoopus-5$0.1847200

14:28:5597f31fb1lleosonnet-5$0.1243200

14:27:4138aa08d8aavasonnet-5$0.0847200

14:26:1038aa08d8aavaopus-5—429

14:25:5238aa08d8aavasonnet-5$0.0385200

08Requests

## Every request has a person on it.

-   One row per request: time, session, who ran it, which credential served it, model, tokens, price, status.
-   Failures stay on the record. A 429 sits in the feed between the requests that worked, priced at nothing.
-   A second tab counts the secrets redacted on the way through, in the same log.
-   Every row carries its session, so a burst of requests reads as one sitting, not noise.

09Limits

## Cap the person, not the key.

-   One company default, an override where somebody needs one. A blank field inherits the default above it; windows are day, week and month, on calendar UTC.
-   The cap sits on the person and follows them across every API key you brought: Anthropic, OpenAI, Vertex and OpenRouter count as one number.
-   Over it they stop being served, by one request’s worth at most, because the cap refuses the next lease instead of killing the one in flight. Saving a limit somebody has already blown asks first.
-   Subscription seats are never capped here: they are not billed per token, so their real ceiling is the 5-hour and 7-day windows, one row up.

Spend limits · API keys only · spent this month

MemberMonthlySpent

Everyone$ 150.00—

aava@example.com default$ 150.00$48.15

mmaya@example.com default$ 150.00$9.25

lleo@example.com default$ 150.00$30.90

nnoah@example.com Over$ 60.00$60.14

FAQ

## Questions a team asks before it starts.

Can an agent have its own Google identity?

An owner can connect your company's Google Workspace under **Virtual identities**, then create Google accounts on your domain with Cloud Identity Free. Set up Google's free subscription and turn paid Workspace automatic licensing off for the identities' unit first. Google's consent restrictions still apply: Selan's Workspace app has its branding verified by Google, and its data access is under Google review. Provider sign-in, subscriptions and permission for agent use are separate; **Tokens** keeps its existing connection flow. See [Virtual identities setup](https://selan.ai/docs/virtual-identities).

How do I control Claude Code spend across 40 developers?

Put every developer on the company's accounts through a gateway instead of giving each one a key, then set a spending limit per person. Through Selan, every Claude Code, Codex and Claude Desktop request is recorded with who ran it, which account served it, which model answered and what it cost. More on [controlling spend](https://selan.ai/solutions/spend).

How can I set a monthly spending limit per developer for Claude Code?

Set one company default in Selan and an override for whoever needs one, by day, week or month on calendar UTC; a blank field inherits the default. The limit follows the person across every API key you brought and refuses their next request once it is reached. Subscription seats are not billed per token, so they are not capped here.

How do we keep Anthropic and OpenAI API keys off developers' laptops?

Keep the provider keys on a gateway and sign each developer in as themselves. With Selan, `selan login` leaves one revocable session token on the machine and no Anthropic or OpenAI key, and `selan claude` and `selan codex` reach the providers through Selan. The whole case is in [keeping API keys off laptops](https://selan.ai/guides/claude-code-without-api-keys).

How do I see Claude Code usage and cost per developer and per repository?

Usage ranks every member by tokens and share of the window, beside API charges, total cost and cache hits, and Insights splits the same week by repository and by person. Insights, and recording which repository a session belonged to, are switches an owner turns on, with no backfill. See [Insights](https://selan.ai/solutions/insights) and [usage per developer](https://selan.ai/guides/claude-code-usage-per-developer).

Can our developers use GPT or DeepSeek inside Claude Code, chosen by the company?

Yes. An owner connects the company's accounts once and switches on the models the team may use, and they appear in the `/model` picker for everyone. GPT runs on a ChatGPT plan, an OpenAI API key or OpenRouter, DeepSeek on Ollama Cloud or OpenRouter. See [models](https://selan.ai/solutions/models), [GPT in Claude Code](https://selan.ai/guides/gpt-in-claude-code) and [DeepSeek in Claude Code](https://selan.ai/guides/deepseek-in-claude-code).

How do I stop secrets in our code from reaching the LLM provider?

Run Claude Code through Selan and have an owner turn on secret scanning for the company. Each request is swept with Gitleaks' own rule set, and every match is replaced with a placeholder before the request goes on to the provider, for Codex and Claude Desktop too. More on [keeping secrets out](https://selan.ai/solutions/secrets).

Is there an EU-hosted way to run Claude Code and Codex on company accounts?

Selan is built and hosted in the EU and serves Claude on a Google Cloud project your company owns to Claude Code and Codex, with no provider key on any laptop. It connects that project on Vertex's Global location, which is not pinned to the EU. Which providers keep inference in the EU is in [Claude Code EU data residency](https://selan.ai/guides/claude-code-eu-data-residency).

What is the alternative to LiteLLM for a team's Claude Code and Codex?

A hosted gateway for the coding tools themselves: with Selan, each developer signs in once and every request is recorded and limited under their name, with nothing to run. LiteLLM is an open-source proxy you deploy yourself, and for an app of your own on many providers it is the better answer. See [LiteLLM and Selan](https://selan.ai/compare/litellm).

## Every number above is the product.

The screens on this page are the running app over one week of a four-person team. Point yours at it and they fill with your own day.

[Get started](https://selan.ai/docs)
