eBRBe
View eBRBe Pricing & Free Plan →

One API Key per Client: How Agencies Split AI Coding Costs

Published 2026-12-02 · By the eBRBe team · Operated by MeWeBe Limited

Short answer: model providers report usage by API key, workspace or project, never by client. So give each client its own: an Anthropic workspace with its own key, an OpenAI project with its own key, or a Google Cloud project for Gemini. Make sure every coding agent uses that client's key while you work on their code (a subscription login doesn't count, because it has no key). At month end, the provider's usage or cost report for that key is the client's AI cost. Invoice it as its own line next to the hours, at cost or with a stated markup.

Where each provider draws the line

ProviderUnit to create per clientWhere you read the costSpend cap
Anthropic (Claude API)A workspace, with a key scoped to it (up to 1,000 workspaces per organisation by default)Console Usage page, filtered by API key or workspace; Cost page by workspace; CSV export (Anthropic help)Monthly limit and email alerts per workspace
OpenAIA project; a key created inside it is scoped to that projectUsage dashboard, filtered by API key and grouped by project; use Cost data for billed amounts (OpenAI help)Per-project spend limit; a hard limit is optional
Google (Gemini API)A Google Cloud project: keys live inside a project and have no billing of their ownAI Studio Dashboard > Usage; Cloud Billing cost pagesProject spend cap (experimental)

On Google the project, not the key, is the unit: every key in a project counts towards the same project, so one client means one project.

Step 1: create the client's workspace or project and its key

Step 2: make each coding agent use that client's key

A per-client key only helps if the agent actually sends it. Each tool reads its key differently:

Whatever the tool, never commit a client's key to their repository.

Step 3: read the cost per client, after the month closes

For a handful of clients, the dashboards are enough: filter Anthropic's Usage page by the client's key, or OpenAI's usage dashboard by key or project, and export the month. At scale, both providers have admin APIs. Anthropic's usage report groups by API key and workspace (cost by workspace), and its newer analytics API breaks cost down by workspace, API key and model. OpenAI's Costs API groups by project and API key. All of these need an organisation admin key, not the client's key.

Mind the delay. Anthropic says usage typically appears within about 30 minutes in the usage report and cost data is daily; the analytics API refreshes within 4 hours and can take up to 24. OpenAI says recent usage may take time to appear. Invoice the previous month, not today's figure.

Pitfalls that break the split

Step 4: put it on the invoice with eBRBe

On Pro and above, eBRBe's Anthropic and OpenAI usage sync reads your organisation's usage and cost reports with an admin key, grouped by API key and by workspace or project. You map each client's key or workspace to that client once; from then on the usage arrives as agent runs on the client's project, and re-syncs update rather than duplicate. eBRBe also compares the provider's total with what has been attributed, so spend on a key you forgot to map shows up. For Google, OpenRouter or other providers, add the month's cost per client with the CSV import or the REST API (POST /api/v1/agent-runs with cost_usd). The runs then sit on the client's invoice next to the hours, with your markup.

At cost, or with a markup?

Both are common. At cost is the most transparent; cost plus a stated percentage pays for choosing, running and reviewing the agent's work. Compare pricing models in our guide to billing AI agent costs, work out your numbers with the AI agent cost & markup calculator, and see what each Claude model costs per coding-agent run. Tool by tool: how to bill clients for Claude Code, OpenAI Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Aider and Cline usage.

A contract clause you can adapt

Agree the rule in the statement of work before the first invoice. A starting point (have it checked for your jurisdiction; this is not legal advice):

"We use AI development tools with model provider API keys dedicated to your project. The provider's charges for those keys are invoiced monthly as a separate 'AI usage' line at cost plus [X]%, with the provider's usage report available on request. We will not exceed [amount] of AI usage in a month without your written approval. If you prefer, you may supply your own API keys, in which case the provider bills you directly."

Frequently Asked Questions

Why use one API key per client?

Because model providers report usage by key, workspace or project, not by client. Anthropic's Console usage page can be filtered by API key and workspace, and OpenAI's usage dashboard can be filtered by API key and grouped by project. If each client has its own key or workspace, the provider's own report is already your per-client cost, with nothing to estimate.

Does this work if I use Claude Code with a Pro or Max subscription?

No. A subscription login has no API key, so there is nothing to split at the provider. Claude Code only bills a key when one is set: its docs say ANTHROPIC_API_KEY is used instead of a Pro, Max, Team or Enterprise subscription even if you are logged in (you approve it once in interactive mode). The same applies to Codex: signing in with ChatGPT uses your subscription, while an API key is billed through your OpenAI Platform account.

How do I make Claude Code use a different key in each client repo?

Claude Code's settings reference recommends apiKeyHelper for API credentials: a command that prints the key. It can go in any settings file, including the per-project .claude/settings.local.json, which is meant for you in one project and is kept out of git. Point it at the client's key in your password manager. Alternatively, export ANTHROPIC_API_KEY in the shell you open for that client. Never commit a key to the repository.

How quickly does the cost show up?

Not instantly. Anthropic's legacy usage report says usage typically appears within about 30 minutes and cost data is daily; its newer analytics API refreshes within 4 hours and can take up to 24. OpenAI says recent usage may take time to appear and to use Cost data for billed amounts. Invoice from the closed month, not from today's dashboard.

Can a spend limit stop a client's budget being overrun?

It helps but is not a hard guarantee. Anthropic lets you cap a workspace's monthly spend and set email alerts, though its docs warn a limit on the default workspace might not stop some usage. OpenAI project spend limits only monitor unless you turn on the hard limit, and even then enforcement is not instantaneous. Keep an approval threshold in the contract as well.

Does eBRBe read these per-key costs?

Yes. On Pro and above, eBRBe's usage sync reads your Anthropic and OpenAI usage reports with an admin key, grouped by API key and by workspace or project. Map each client's key or workspace to that client once and the costs arrive as agent runs on the client's project, ready for the invoice. For Google, OpenRouter or anything else, add the month's cost per client by CSV import or the REST API.

Next step on eBRBe

eBRBe puts Claude Code, Codex, Aider, Cline and other AI agent costs on the same client invoice as human hours, with your markup, and the client pays online. Free for up to 3 people; paid plans from $9 per member a month, with a 14-day trial. Want to see it first? Explore the demo: a read-only workspace with made-up data, no account needed.

Explore the demo or sign up free →