How to bill for AI coding sessions: from session to draft invoice
Last updated: July 2026
AI agents made a strange billing problem normal. A feature that used to be a clean eight-hour block is now twenty minutes of prompting, a few minutes watching an agent run, and an hour of review — scattered across the day. The work is real and billable, but it no longer looks like a block of time. This is a practical path from a raw coding session to a line on an invoice.
Capture the session first
You cannot bill what you did not record, and AI work is exactly where recording falls apart. Manual timers assume a steady single task; the start-stop rhythm of prompting and reviewing means you forget to click, and the hours quietly evaporate. Automatic capture — reading the session and dropping idle time — is far more reliable. Whatever tool you pick, the non-negotiable is that every session lands somewhere with a timestamp and a project attached. Døgn does this by tracking your Claude Code, Codex and Antigravity sessions automatically, but a DIY hook or another tracker works too; the principle is what matters.
Turn raw session time into billable hours
Raw session time is not the same as billable hours. Three things bridge the gap:
- Idle detection. Drop the minutes you were away — meetings, coffee, a call — so the number is honest and defensible if a client ever asks. This is the single biggest difference between a figure you can stand behind and one you cannot.
- A client and project on every entry. Tag each session as you go so hours roll up by who you actually bill, instead of one undifferentiated pile at month's end.
- A description that means something. "Implemented the Stripe webhook handler and tests" is billable; "Claude Code, 47 min" is not. Døgn writes this line on-device automatically, so the entry is already client-ready.
From hours to a draft invoice
Once entries carry a client, a duration and a description, the invoice is mostly assembly: group the month by client, apply your rate, attach the descriptions as line items. Some tools stop at a CSV export and leave the retyping to you. Døgn closes the loop — an HMAC-signed webhook hands the finished entries to a draft invoice you review and send, so a month of tracked sessions becomes a document instead of an evening of copy-paste. See how the whole flow fits together.
Hourly vs value-based — a short honest note
AI compresses time, which puts pressure on hourly billing: if a task that was eight hours is now two, pure hourly quietly hands your productivity gain to the client as a discount. Value-based pricing charges for the outcome, so that speedup accrues to you. Upwork's own data shows AI-skilled freelancers commanding a premium — on the order of 40% more per hour — because clients pay for results delivered well, not for hours logged.
That said, hourly still fits open-ended and maintenance work fine. The point is not which model wins; it is that both need an honest record. Hourly needs it to bill without a fast month looking like you barely worked. Value-based needs it to price the next project from what the last one actually took.
A note on disclosure
Some clients and platforms require you to disclose AI-assisted work; a few contracts prohibit it outright. When you are unsure, be transparent about which parts involved an agent — it is rarely held against you, and it protects the relationship. A clear per-session description does double duty here: it is your billing line item and, if asked, your record of what the AI actually did.
Questions, answered
Should I bill for the AI's time or my time?
You bill for the work delivered and your judgement, not the agent’s wall-clock. Track your engaged time — prompting, reviewing, fixing. Minutes an agent ran unattended while you were away are debatable; drop them if in doubt, and idle detection handles that for you.
Hourly or fixed-price for AI-assisted work?
Fixed or value-based pricing captures the AI speedup for you rather than discounting it to the client, and tends to pay better. Hourly is simpler for open-ended or maintenance work. Either way, record your time so you can price the next project from real numbers.
How do I write a line item for an AI coding session?
Describe the outcome, not the tool: "Built and tested the Stripe webhook handler (2.1h)," not "Claude Code session." A one-line summary of what changed is what makes the entry billable and clear to the client.
Do I have to tell my client I used AI?
Sometimes contractually, yes; otherwise it is a judgement call, and many freelancers disclose to stay transparent. A per-session description makes it easy to show exactly what was done if the question ever comes up.