Skip to content

PRICING

AI Coding Budget for Freelancers: Measure the Client Mix

An AI coding budget for freelancers needs a project ledger, a retention window, and a clear split between API-equivalent use and the bill you actually pay.

An AI coding budget for freelancers should follow client work, not divide a seat fee equally across invoices. Measure each project's usage, then separate its share of work from the amount your account was actually charged. Our guide to AI tools for freelance developers covers which tools fit solo work; this article supplies the accounting method behind that decision. The evidence is an aggregate of local Claude Code session records collected for a 30-day window and checked on October 13, 2026. No client-level rows or activity dates appear here.

Key takeaways

  • Fifteen client project folders generated $2,592.47 in API-equivalent Claude Code usage across the measured window. That is a workload value, not proof of a $2,592.47 invoice.
  • The largest client represented 45.3% of client usage; the two largest represented 70.1%. A flat per-client allowance would hide that concentration.
  • Fifty-seven client sessions appeared in the sample, and one had no price record. The total therefore understates whatever that session consumed.
  • Claude Code's default local retention is 30 days. Monthly exports need to happen before the underlying transcripts disappear.

The budget starts with a ledger

Assign every AI-assisted session to a project before you decide what to charge. In this repository, scripts/client-ledger.mjs reads the last cumulative cost-state record for each Claude Code session, groups sessions by project folder, and excludes scratch and owner projects from the client total. The committed client-ledger.json contains aggregates only; the detailed output stays local.

This grouping is a proxy. A folder is not always one client: a shared repository can serve two clients, and one client can have several repositories. Use a private mapping file for those cases. The published measurement uses 15 folders, so it cannot prove that there were exactly 15 commercial clients.

The method also has an accounting boundary. It reads Claude Code's API-equivalent session cost, not a subscription invoice, labor time, or every tool used on a project. Our monthly Claude Code cost guide explains the three payment routes before you translate this workload into a cash budget.

What the 30-day aggregate shows

The 30-day snapshot contains 15 client folders, 57 client sessions, and $2,592.47 of API-equivalent usage. The largest folder contributed 45.3%; the largest two together contributed 70.1%. Four owner projects were excluded. One client session had no cost-state record and is not priced.

MeasureAggregate resultWhat it means
Client folders15Folder count, not verified client count
API-equivalent usage$2,592.47Workload at the tool's reported prices
Largest share45.3%One project dominated the client total
Largest two shares70.1%Most usage sat in two projects
Sessions without a price1 of 57Reported total is incomplete

The concentration is the useful result. If a $100 shared seat were allocated equally, each of 15 folders would receive $6.67. Allocation by measured share would put roughly $45.30 against the largest folder. Neither number is a client invoice; each is a different internal cost allocation. The aggregate does not reveal the project's name, its exact spend, or its activity dates.

Separate usage from payment

Anthropic's Claude Code cost documentation says /usage estimates session dollars from token counts at list prices. Pro and Max subscribers have usage included in their plan; usage credits can add a separate charge. The Claude Console is authoritative for API-key billing. An API-equivalent ledger is useful for dividing a shared seat among jobs, but adding it to the seat invoice would double-count work.

Keep two columns in private records:

ColumnSourcePurpose
Actual cash paidSubscription invoice, credits, or API billBusiness expense and margin
API-equivalent usageSession cost ledgerWorkload attribution and forecasting

If clients reimburse tool costs, agree on the basis in advance. A proportional share of a subscription is different from charging list API rates. The cross-vendor pricing comparison helps select a payment model; the ledger tells you how that model's work was distributed.

Allocate a shared seat

For an internal allocation, divide a project's measured API-equivalent usage by the measured client total, then multiply by the shared seat cost. Apply the formula only to projects in the same accounting window. If owner work also used the seat, first decide whether the seat is allocated across all work or only client work; excluding owner work from the denominator moves more cost onto clients.

Allocation formula
project share = project API-equivalent usage / eligible usage total
allocated seat = project share × actual seat charge

The aggregate supports a concentration estimate, not a published per-client bill. It also does not measure whether AI assistance improved delivery time or quality. Keep those decisions in a separate profitability record rather than interpreting token cost as return on investment.

Keep the measurement before it expires

Anthropic's Claude Code directory documentation says local transcripts are cleaned up after cleanupPeriodDays, 30 days by default. The measured window spans 30 days. Waiting another month and rerunning the script will not reconstruct the same history from local transcripts.

Export a private aggregate at the end of each billing period and retain the detailed mapping only where your client records belong. The public fixture intentionally omits project rows, names, paths, and activity dates. We re-check its aggregate figures and the documentation's retention statement with an internal check script; the check does not read private transcripts.

Best practices

  • Tag work before invoicing. A project-to-client mapping is easier to maintain while the work is fresh.
  • Reconcile to the real bill. Use subscription or API invoices for cash, and session costs for allocation.
  • Export monthly. Local history has a default 30-day cleanup window.
  • Keep gaps visible. An unpriced session makes a total a lower bound, not a complete bill.

Common mistakes

  • Dividing the seat evenly. It is easy, but the measured workload was concentrated in two folders. Use a stated allocation rule.
  • Calling API-equivalent usage cash spend. The session estimate and the subscription bill are different records; label them separately.
  • Publishing a detailed client ledger. Project dates and spend can disclose business relationships even after names are replaced. Keep public evidence aggregate-only.

Conclusion

Build the freelance AI budget from a private project ledger and the actual payment record. This site's 30-day aggregate shows why equal per-client allocation can be misleading, while its one unpriced session shows why a transcript-derived total has limits. Use measured shares for internal planning, agree on any client reimbursement method, and export before retention removes the source data. For the account-level bill, start with Claude Code cost per month.

Frequently asked questions

How should a freelancer budget AI coding costs per client?
Record usage by project for a full billing period, then allocate shared subscriptions by each client's share of measured work. Keep API-equivalent usage separate from the subscription you actually paid. On our 30-day aggregate, the largest client accounted for 45.3% of client usage and the two largest accounted for 70.1%, so an equal split would misstate the workload.
Is Claude Code's session cost my actual bill on a subscription?
No. Anthropic says the session cost in /usage is calculated from token counts at API list prices, while Pro and Max usage is included in the subscription. Treat that figure as a workload allocation signal. Use your subscription invoice and any usage-credit charges for actual cash cost, or the Claude Console if you use an API key.
Can I reconstruct last year's client AI spend from Claude Code transcripts?
Usually not from the default local history alone. Anthropic documents a 30-day default cleanup period for Claude Code session data. Our aggregate spans 30 days and includes one unpriced client session, so it is already an incomplete cost record. Export a private summary on a schedule if you need longer-term accounting.
Should I publish my per-client AI cost ledger?
A public guide rarely needs per-client rows. This article publishes only aggregate counts, total API-equivalent usage, concentration shares, and the sample coverage. The committed fixture has no client names, project paths, row-level spend, or activity dates. Keep the detailed ledger in your own accounting system and share it only under your client agreements.

Muhammad Kashif

Founder and editor of Devventa, covering AI coding assistants, Next.js and the modern AI development stack.