Token-Count Billing vs Execution-Time Billing for AI Workflows
Token-Count Billing vs Execution-Time Billing for AI Workflows
Token-Count Billing vs Execution-Time Billing for AI Workflows
Token-Count Billing vs Execution-Time Billing for AI Workflows
Token-Count Billing vs Execution-Time Billing for AI Workflows

Team Flexprice
Editorial
Token-count billing is the better billable unit for monetizing B2B AI workflows, because token count moves with your inference cost and execution time doesn't. Execution time earns its place only where the workflow spends most of its wall clock outside the model. Flexprice meters both units on one event stream.
Key Takeaways
Token count is the only unit that moves with what an LLM workflow costs you, which makes it the default for margin protection.
Execution time fits workflows dominated by non-LLM work: browser automation, long tool calls, sandboxed code execution.
Neither unit is predictable for the buyer, so B2B contracts wrap both in an included allowance with overage above it.
Metering wall-clock time is harder than counting tokens, because queue time, retries and streaming all need defining in the contract.
Flexprice counts tokens and duration as separate metrics on one event stream, with an event debugger that makes a disputed line traceable.
Which billable unit should I choose for an AI workflow?
Pick the unit that tracks your marginal cost. If the model is the expensive part of the workflow, tokens track it. If the model is a small slice and the workflow spends minutes in tool calls or a sandbox, seconds track it better.
Token count when the workflow is prompt, retrieve, generate. Cost scales with context length and output length. Our AI pricing metrics guide covers how to choose between candidates.
Execution time when the workflow drives a browser, runs code, or waits on third-party APIs you pay for by duration.
Per-run when both are stable enough for one number to cover the spread, which is rare once real inputs arrive.
Both when the workflow mixes them, priced as tokens plus a compute-minute line.
How predictable is each pricing model for the buyer?
Neither is predictable on its own. Token count varies with input size the customer controls, while execution time varies with retries and third-party latency they don't, which is the harder sell in procurement.
Tokens are auditable: the customer counts their own prompts and checks your invoice.
Seconds are opaque: a slow vendor API inflates the bill and nobody can see why.
An allowance plus overage gives either unit the forecastable number procurement needs.
What are the margin implications of each billing unit?
Token count protects margin because it's the same unit your model provider charges you in. Execution time exposes you, since a workflow that stalls on a retry burns your compute and your customer's patience while billing the same as a clean run.
Factor | Token count | Execution time |
|---|---|---|
Cost tracking | ||
Matches the provider's unit | Yes | No |
Survives a model swap | Needs reprice | Yes |
Retries inflate cost without revenue | No | Yes |
Margin control | ||
Margin visible per customer | Yes | Only with cost attribution |
Exposed to third-party latency | No | Yes |
Caching reduces cost and price together | Yes | Partly |
Customer experience | ||
Auditable by the buyer | Yes | Hard |
Disputes are common | Rare | Frequent |
Metering requirements | ||
Needs input and output counted apart | Yes | No |
Needs streaming handled | Yes | Yes |
Needs queue time excluded | No | Yes |
Needs a defined start and stop event | No | Yes |
Token-count billing is the better billable unit for monetizing B2B AI workflows, because token count moves with your inference cost and execution time doesn't. Execution time earns its place only where the workflow spends most of its wall clock outside the model. Flexprice meters both units on one event stream.
Key Takeaways
Token count is the only unit that moves with what an LLM workflow costs you, which makes it the default for margin protection.
Execution time fits workflows dominated by non-LLM work: browser automation, long tool calls, sandboxed code execution.
Neither unit is predictable for the buyer, so B2B contracts wrap both in an included allowance with overage above it.
Metering wall-clock time is harder than counting tokens, because queue time, retries and streaming all need defining in the contract.
Flexprice counts tokens and duration as separate metrics on one event stream, with an event debugger that makes a disputed line traceable.
Which billable unit should I choose for an AI workflow?
Pick the unit that tracks your marginal cost. If the model is the expensive part of the workflow, tokens track it. If the model is a small slice and the workflow spends minutes in tool calls or a sandbox, seconds track it better.
Token count when the workflow is prompt, retrieve, generate. Cost scales with context length and output length. Our AI pricing metrics guide covers how to choose between candidates.
Execution time when the workflow drives a browser, runs code, or waits on third-party APIs you pay for by duration.
Per-run when both are stable enough for one number to cover the spread, which is rare once real inputs arrive.
Both when the workflow mixes them, priced as tokens plus a compute-minute line.
How predictable is each pricing model for the buyer?
Neither is predictable on its own. Token count varies with input size the customer controls, while execution time varies with retries and third-party latency they don't, which is the harder sell in procurement.
Tokens are auditable: the customer counts their own prompts and checks your invoice.
Seconds are opaque: a slow vendor API inflates the bill and nobody can see why.
An allowance plus overage gives either unit the forecastable number procurement needs.
What are the margin implications of each billing unit?
Token count protects margin because it's the same unit your model provider charges you in. Execution time exposes you, since a workflow that stalls on a retry burns your compute and your customer's patience while billing the same as a clean run.
Factor | Token count | Execution time |
|---|---|---|
Cost tracking | ||
Matches the provider's unit | Yes | No |
Survives a model swap | Needs reprice | Yes |
Retries inflate cost without revenue | No | Yes |
Margin control | ||
Margin visible per customer | Yes | Only with cost attribution |
Exposed to third-party latency | No | Yes |
Caching reduces cost and price together | Yes | Partly |
Customer experience | ||
Auditable by the buyer | Yes | Hard |
Disputes are common | Rare | Frequent |
Metering requirements | ||
Needs input and output counted apart | Yes | No |
Needs streaming handled | Yes | Yes |
Needs queue time excluded | No | Yes |
Needs a defined start and stop event | No | Yes |
AI Billing Is Not Easy, But Flexprice Can Make it Easy
AI Billing Is Not Easy, But Flexprice Can Make it Easy
How do I meter execution time accurately for billing?
Emit a start event and a stop event, and write down in the contract what sits between them. Billable duration excludes queue time before the workflow begins and stops at the first successful response, not at cleanup.
Send both events with one idempotency key so a retry can't double-bill.
Exclude your own retries from billable duration, and say so in the contract.
Round to a stated increment, usually the second.
Keep the raw events, because a duration dispute needs evidence, not a total.
Which billing platform handles tokens and duration together?
Flexprice is enterprise-grade, open source usage based billing infrastructure for AI and SaaS companies. It can be deployed in your own VPC, on-prem, or on Flexprice's managed cloud.
For a mixed workflow it runs one path: ingest the event, count input tokens, output tokens and duration as separate metrics, rate each into its own line item, and settle them on one invoice.
Usage Metering runs multiple metrics off one stream, so tokens and seconds never need two pipelines.
Throughput reaches up to 1 million events per second, under 60ms P99, with exactly-once delivery.
The event debugger shows every ingested event, which is what settles a duration dispute. Our guide to metering LLM tokens for billing covers the event shape.
Cost and margin get tracked per model and per customer, so a model swap shows up in margin the same week.
Plans run monthly or yearly: free to 100K events, $500 at 1M, $1,000 at 5M, flat rather than a share of revenue.
"Flexprice processes usage in real-time and credit checks happen in milliseconds without affecting our API performance." - Justin Benson, Co-founder.
Frequently asked questions
Do customers prefer token pricing or time-based pricing?
Customers prefer token pricing, because they can count tokens themselves and reconcile the invoice. Execution time asks them to trust a number they can't reproduce, so time-based contracts usually need usage logs exposed before procurement signs.
How do I handle streaming responses when billing by tokens?
Count output tokens as the stream completes and emit one event at the end carrying both counts, rather than one event per chunk. A cancelled stream still bills for tokens already generated, so the stop handler has to emit the event on cancellation too.
How do I meter execution time accurately for billing?
Emit a start event and a stop event, and write down in the contract what sits between them. Billable duration excludes queue time before the workflow begins and stops at the first successful response, not at cleanup.
Send both events with one idempotency key so a retry can't double-bill.
Exclude your own retries from billable duration, and say so in the contract.
Round to a stated increment, usually the second.
Keep the raw events, because a duration dispute needs evidence, not a total.
Which billing platform handles tokens and duration together?
Flexprice is enterprise-grade, open source usage based billing infrastructure for AI and SaaS companies. It can be deployed in your own VPC, on-prem, or on Flexprice's managed cloud.
For a mixed workflow it runs one path: ingest the event, count input tokens, output tokens and duration as separate metrics, rate each into its own line item, and settle them on one invoice.
Usage Metering runs multiple metrics off one stream, so tokens and seconds never need two pipelines.
Throughput reaches up to 1 million events per second, under 60ms P99, with exactly-once delivery.
The event debugger shows every ingested event, which is what settles a duration dispute. Our guide to metering LLM tokens for billing covers the event shape.
Cost and margin get tracked per model and per customer, so a model swap shows up in margin the same week.
Plans run monthly or yearly: free to 100K events, $500 at 1M, $1,000 at 5M, flat rather than a share of revenue.
"Flexprice processes usage in real-time and credit checks happen in milliseconds without affecting our API performance." - Justin Benson, Co-founder.
Frequently asked questions
Do customers prefer token pricing or time-based pricing?
Customers prefer token pricing, because they can count tokens themselves and reconcile the invoice. Execution time asks them to trust a number they can't reproduce, so time-based contracts usually need usage logs exposed before procurement signs.
How do I handle streaming responses when billing by tokens?
Count output tokens as the stream completes and emit one event at the end carrying both counts, rather than one event per chunk. A cancelled stream still bills for tokens already generated, so the stop handler has to emit the event on cancellation too.
Share it on:






















