How to Bill Clients for OpenAI Codex Usage
Short answer: First find out how you pay for Codex. If Codex runs on your OpenAI API key, give each client its own OpenAI project (or API key): OpenAI then reports usage and cost per client, and you can invoice that at cost or with a stated markup. If Codex runs on a ChatGPT plan, there is no per-token bill to split, so recover the seat with a fixed AI tooling fee or treat it as overhead. Either way, put the rule in the contract and show AI usage as its own invoice line next to the hours.
Two ways Codex gets paid for, and why it matters
OpenAI's Codex coding agent can be used signed in with a ChatGPT plan, or with an OpenAI API key. The two produce very different bills:
| How you run Codex | What you pay | Can you split it by client? |
|---|---|---|
| OpenAI API key | Per token, on your OpenAI platform bill | Yes: OpenAI reports usage and cost per project and per API key |
| ChatGPT plan | A monthly seat price | No per-token bill; only a fixed or time-based split |
Many teams use both. Settle which is which before you promise a client line-item AI costs.
Method 1: one OpenAI project per client (most accurate)
- In the OpenAI platform, create a project for each client (or each client engagement) and an API key inside it.
- Use that client's key when you run Codex on their repository, for example by setting it in the shell or the project's environment you open for that client.
- At month end, the platform's usage and cost reports show each project's spend. That figure is the client's AI usage for the month.
- In eBRBe: an owner or admin creates an OpenAI admin key (read-only for usage; it cannot call models) and adds it under Settings → Integrations → AI provider usage. Map each OpenAI project or key to an eBRBe client or project. The provider usage sync runs daily, imports usage and cost per project, key, model and day, and turns each mapped group into an agent run you can put on the invoice with your markup (Pro plan and above). Costs come from OpenAI's own cost report, so you are billing what OpenAI actually charged.
- Reconcile: Agent costs → Reconciliation shows how much of the month's OpenAI total is attributed to a client and what is left unattributed, so nothing slips through and nothing is billed twice.
- Watch for: one key shared across clients cannot be split afterwards by the provider. Keep keys separate from day one.
Method 2: log each run with its exact cost
If you cannot split keys (one shared key, a client who wants per-task detail, or work done on someone else's account), log runs against the client's project directly:
- With the MCP
log_agent_runtool from Claude, ChatGPT or Cursor (MCP setup). - With the REST API:
POST /api/v1/agent-runswith the model, token counts and the client's project. Sendcost_usdwith the amount OpenAI charged. eBRBe's built-in price table currently covers Anthropic models, so for OpenAI models send the cost explicitly (or ask your eBRBe platform admin to add the model's price). - By hand in the app, for occasional runs.
eBRBe's CLI includes a Codex hook that reads each session's token totals from ~/.codex/sessions after every turn. The @ebrbe/cli package is not on npm yet, so for now use the usage sync or the two routes above.
Method 3: ChatGPT-plan seats — a fixed AI tooling fee
A ChatGPT seat costs the same whether a developer runs Codex for one client or five. Metering it per client adds work without adding accuracy. Two honest options:
- Absorb it as overhead, like your editor or Git hosting.
- Charge a fixed monthly "AI development tools" line per active client, sized to cover the seats, and review it every quarter against what you paid.
If you want a usage-based split anyway, divide the seat cost across clients by the hours each developer logged on each client that month. Hours are a key clients already understand.
Which method fits
| Your situation | Use | What the client sees |
|---|---|---|
| Codex on your API key, clients who want detail | Method 1: OpenAI project per client | Monthly AI usage at cost, or cost plus your markup |
| One shared key, or per-task reporting | Method 2: log runs with cost | AI usage lines per task or per month |
| ChatGPT-plan seats | Method 3: fixed fee or absorb | A fixed "AI development tools" line, or nothing |
On markup: pass-through at cost is the most transparent; cost plus a stated percentage pays for choosing, running and reviewing the agent's work. Our guide to billing AI agent costs compares the pricing models, and the AI agent cost & markup calculator works out the numbers. Using Cursor as well? See how to bill clients for Cursor usage. Running Claude models too? See what a run costs on each Claude model. Also see how to bill clients for Claude Code, 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, including OpenAI Codex, in delivering the services. Usage-based charges for these tools incurred on the API key or project assigned to your work are invoiced monthly as a separate 'AI usage' line, at cost plus [X]%, as reported by the provider. Fixed subscription costs are [not charged separately / covered by a fixed AI tooling fee of [amount] per month]. We will not exceed [amount] of AI usage in a month without your written approval."
eBRBe's AI agent build project template is set up for this kind of engagement.
Frequently Asked Questions
Can I charge a client for my Codex usage?
Yes, if the contract says so. Agree before work starts whether AI usage is passed through at cost, charged with a stated markup, covered by a fixed fee or absorbed, and show it as its own invoice line.
How do I split OpenAI API usage by client?
Create one OpenAI project (or one API key) per client and use that key for the client's Codex work. OpenAI reports usage and cost per project and per key, so each client's share is already separated. eBRBe's provider usage sync reads those reports daily and maps each project or key to a client (Pro plan and above).
What if I use Codex through a ChatGPT plan?
A ChatGPT plan has no per-token bill to split. Treat the seat as overhead, or recover it with a fixed monthly AI tooling fee per client that the contract names.
Does eBRBe log Codex sessions automatically?
Through the OpenAI usage sync, yes, for usage billed to your API keys. eBRBe's CLI also has a Codex hook that reads each session's token totals, but the @ebrbe/cli package is not on npm yet. Until it is, use the usage sync, the MCP log_agent_run tool or the REST API.
Next step on eBRBe
eBRBe puts AI agent costs and human hours on the same client invoice, 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 eBRBe workspace with made-up clients, agent runs and invoices, no account needed.
Explore the demo or sign up free →