Billing and plans
Does routing Claude through the gateway use our Claude Enterprise or Team seats, or create a separate API bill?
Does routing Claude through the gateway use our Claude Enterprise or Team seats, or create a separate API bill?
- Model account has an Anthropic API key → every request is billed per token to that key. The user’s seat is not involved. This is the only option for Claude Desktop / Cowork, and one of two options for Claude Code.
- Model account has no API key (subscription passthrough) → the gateway forwards the user’s own Claude login token, and usage draws from their seat or subscription. Only Claude Code can do this, because it is the only client with a Claude login flow.
We're on Pro, Max, or Team. Can Claude Code use our subscription through the gateway?
We're on Pro, Max, or Team. Can Claude Code use our subscription through the gateway?
ANTHROPIC_AUTH_TOKEN unset, and put your TrueFoundry key in ANTHROPIC_CUSTOM_HEADERS as x-tfy-api-key. The user signs in with their Claude account when Claude Code starts; the gateway authenticates them with the TrueFoundry key and forwards their Claude token to Anthropic. Usage draws from the subscription, and the gateway still records every request per user.Setup is under Authentication and who pays.Does Claude Desktop / Cowork in third-party mode use the user's seat?
Does Claude Desktop / Cowork in third-party mode use the user's seat?
What happens when a subscription user hits their rate limit mid-session?
What happens when a subscription user hits their rate limit mid-session?
0 and a pay-per-token Anthropic account as the fallback. The gateway uses the subscription until it is rate-limited, then routes overflow to the API key. Only one target in a virtual model can be a passthrough account, since there is only one Authorization header to forward.Steps are under Fall back from the subscription to the Anthropic API.Is the cost shown in Analytics a bill?
Is the cost shown in Analytics a bill?
Can Claude apps use Bedrock, Vertex, or Microsoft Foundry instead of Anthropic directly?
Can Claude apps use Bedrock, Vertex, or Microsoft Foundry instead of Anthropic directly?
anthropic-beta headers and new request fields pass through unfiltered. On other providers the gateway checks each beta against a per-provider allowlist and drops the rest, Anthropic’s server-side tools (built-in web search) don’t run, and model ids differ. Claude Code and Desktop work, but some of their newest features arrive later or not at all. See Forwarding Anthropic beta features.Authentication and identity
How does the gateway know which user a request came from?
How does the gateway know which user a request came from?
Authorization: Bearer <token> or in the x-tfy-api-key header. The gateway recognises three kinds: tokens it issued (Personal Access Tokens, Virtual Account tokens, and the short-lived tokens tfy-local-ai-setup mints from a device login), JWTs from an identity provider you have registered, and, in SWG mode, an X-Authenticated-User assertion from a trusted upstream proxy.The identity is as good as the token. One Personal Access Token pasted into a shared managed-settings.json makes the whole fleet look like one user. The MDM binary mints a separate token per user from their own SSO login, which is what gives per-user attribution at scale. See Enforce with MDM.Why does the Claude Code config sometimes have the key in ANTHROPIC_AUTH_TOKEN and sometimes in x-tfy-api-key?
Why does the Claude Code config sometimes have the key in ANTHROPIC_AUTH_TOKEN and sometimes in x-tfy-api-key?
ANTHROPIC_AUTH_TOKEN becomes the Authorization header. In API-key mode that header carries your TrueFoundry key and nothing else is needed. On subscription passthrough Claude Code reserves Authorization for the user’s Claude login token, so the TrueFoundry key moves to x-tfy-api-key in ANTHROPIC_CUSTOM_HEADERS. The gateway checks both locations.If MDM pushes the Desktop config, can we still track cost per user?
If MDM pushes the Desktop config, can we still track cost per user?
tfy-local-ai-setup --claude-desktop mints that per user: it runs the device login as the signed-in user, writes that user’s token into the per-user managed preferences, locks the file, and refreshes it on every run. Each Desktop request then carries that user’s identity and appears under their name in Analytics, exactly as Claude Code does. See Claude Desktop → MDM.Can the gateway authenticate users with their Claude login token instead of a TrueFoundry token?
Can the gateway authenticate users with their Claude login token instead of a TrueFoundry token?