Set up with your coding agent. Add the Kelviq docs MCP server (
https://docs.kelviq.com/mcp) to Claude Code, Cursor or Codex and ask it: “Add credit-based billing to my app with Kelviq. Meter input and output tokens per customer, use sandbox keys from .env.local, and show me the plan before creating anything.”
Most AI products I talk to start the same way. They ship on Claude or OpenAI, charge a flat $20 a month, and it works fine until one customer pastes a 300-page PDF into the chat every morning. Then the model bill for that one customer is bigger than what they pay you.
The fix isn’t always “charge per token”. Customers mostly hate that, because they can’t guess the bill before it arrives. The fix is knowing your cost per unit of work and building a price on top of it that still makes sense when usage is lumpy.
Start with what you actually pay
Here are current list prices for the models most people build on. All prices are per million tokens, standard tier, as of November 23, 2026.
| Model | Input | Cached input (read) | Output | Source |
|---|---|---|---|---|
| Claude Opus 5.5 | $4.00 | $0.20 | $20.00 | Anthropic pricing |
| Claude Sonnet 5.5 | $2.00 | $0.10 | $10.00 | Anthropic pricing |
| Claude Haiku 5.5 (prompts up to 100k tokens) | $0.10 | $0.01 | $0.50 | Anthropic pricing |
| gpt-6-astra | $10.00 | $1.00 | $50.00 | OpenAI pricing |
| gpt-6.1-sol | $2.00 | $0.10 | $10.00 | OpenAI pricing |
| gpt-6-luna | $0.10 | $0.01 | $0.50 | OpenAI pricing |
Output costs 5x input on every one of these. If your feature writes long answers, output is your bill.
The mid-tier models are priced the same. Claude Sonnet 5.5 and gpt-6.1-sol are both $2 in and $10 out, with $0.10 cached reads. So your pricing doesn’t have to change much if you switch between them, which is nice.
Caching and batch move your real cost a lot. A cache read is 5% of the input price on Claude Opus 5.5, Claude Sonnet 5.5 and gpt-6.1-sol, and 10% on Claude Haiku 5.5, gpt-6-astra and gpt-6-luna. Both providers take 50% off for batch (Anthropic’s Batch API, OpenAI’s Flex/Batch tier). Your real cost per request can sit well below list price.
Writing to the cache isn’t free, by the way. On Claude Sonnet 5.5 a 5-minute cache write is $2.50 per million tokens, and on gpt-6.1-sol a 30-minute write is $2.50 too. You pay that once, then the cheap reads.
Work out cost per request, not cost per token
Nobody buys tokens from you. They buy “a chat answer” or “a summarized document” or “an agent run”. So measure that.
Say you have a support chat feature on Claude Sonnet 5.5. A typical request looks like this:
- 4,000 tokens of system prompt and docs, the same every time, so it’s cached
- 2,000 tokens of fresh input (the conversation so far plus the question)
- 800 tokens of output
Here’s what one request costs:
| Line | Tokens | Price per 1M | Cost |
|---|---|---|---|
| Cached input (read) | 4,000 | $0.10 | $0.0004 |
| Fresh input | 2,000 | $2.00 | $0.0040 |
| Output | 800 | $10.00 | $0.0080 |
| Total | $0.0124 |
That’s about $12.40 per 1,000 requests. Without caching, the 4,000 cached tokens would cost $0.008 instead of $0.0004, and the request would cost $0.020. Caching cuts the bill by about 38% here, which is why it’s the first thing I’d set up.
Run the same request on other models and you get a wide spread:
| Model | Cost per request (with caching) | Per 1,000 requests |
|---|---|---|
| Claude Haiku 5.5 | $0.00064 | $0.64 |
| Claude Sonnet 5.5 / gpt-6.1-sol | $0.0124 | $12.40 |
| Claude Opus 5.5 | $0.0248 | $24.80 |
| gpt-6-astra | $0.0640 | $64.00 |
Same feature, a 100x range in cost depending on the model. If you let customers pick the model, your price has to reflect that. More on this below.
Pick a pricing shape
I see three common ways to put a price on top of this.
1. Pass-through with a markup. You meter tokens per customer and bill them at your cost plus, say, 30%, every month. It’s the most honest model and the easiest to defend. It’s also the one most customers find stressful, because they can’t predict the bill. It works best for developer products where the buyer already thinks in tokens (an API, an agent framework).
2. Credits. You sell a pack of credits, and each action costs a fixed number of credits. The customer sees “a Sonnet answer is 5 credits”, not “2,000 tokens at $2 per million”. You do the token math once, inside your price list. This is what most consumer and prosumer AI apps end up with.
3. A subscription with included usage. $29 a month includes 2,000 answers, then you pay per answer, or you get cut off. Predictable for the customer, predictable revenue for you. The included amount is the hard part, because it’s very hard to lower later.
I’m going to work through credits, because it’s where the cost math matters most and where people most often get it wrong.
Turning cost into a credit price
Let’s say one credit sells for 1 cent ($10 buys 1,000 credits). You want about 75% gross margin on model cost, before payment fees.
Cost per request divided by 0.25 gives you the revenue you need per request:
| Model | Cost per request | Revenue needed at 75% margin | Credits per request |
|---|---|---|---|
| Claude Haiku 5.5 | $0.00064 | $0.0026 | 1 (you’ll make more) |
| Claude Sonnet 5.5 | $0.0124 | $0.0496 | 5 |
| Claude Opus 5.5 | $0.0248 | $0.0992 | 10 |
Round to whole credits. Customers can do “5 credits” in their head. They can’t do “4.96”.
Now add the payment side. With Kelviq, a $10 one-time credit pack on a US card costs 3.5% + $0.40, which is $0.75. (A non-US card adds 1.5%, so $0.90.) If a customer spends all 1,000 credits on Sonnet answers, that’s 200 answers, costing you about $2.48 in model fees. So:
| Amount | |
|---|---|
| Customer pays | $10.00 |
| Payment fee (US card) | -$0.75 |
| Model cost (200 Sonnet answers) | -$2.48 |
| Left for you | $6.77 (68%) |
A $10 pack is about as small as I’d go. On a $5 pack the $0.40 fixed fee alone is 8% of the sale.
Store usage like an invoice will be questioned
Because it will be. The first time a customer asks “why did I burn 600 credits yesterday?”, you want the answer in one query.
Record one usage event per model call, with enough to recompute the cost later:
| event_id | customer_id | feature | model | input_tokens | cached_tokens | output_tokens | credits | created_at |
|---|---|---|---|---|---|---|---|---|
| evt_8a1c | cus_001 | chat_answer | claude-sonnet-5-5 | 2,000 | 4,000 | 812 | 5 | 2026-10-22 09:14:03 |
| evt_8a1d | cus_001 | chat_answer | claude-sonnet-5-5 | 2,310 | 4,000 | 1,904 | 5 | 2026-10-22 09:15:41 |
| evt_8a1e | cus_002 | summarize_doc | claude-haiku-5-5 | 61,200 | 0 | 950 | 3 | 2026-10-22 09:16:10 |
Keep the raw token counts even if you only bill credits. You’ll want them for the next price change, and for the margin report you’ll run every month.
The event_id matters too. Retries happen, and if the same model call gets reported twice, you’ll double-charge someone. Use your own ID and skip duplicates before you meter.
Two traps
Trap 1: billing list price when you pay less. If you do pass-through and bill customers at list input price, but your app gets 60% cache hits, you’re overcharging by more than you think. If you go the other way and price credits off a test run that happened to hit the cache, you’re undercharging every customer whose prompts don’t cache (new conversations, long unique documents). Measure cached and uncached tokens separately, from real traffic, and price off the mix.
Trap 2: output and reasoning tokens. Answers that run long cost a lot, because output is 5x input. Reasoning models make it worse: the thinking tokens are billed as output too, and you don’t see them in the answer. A request that “only” returned 300 words can have used several thousand output tokens. Set max_tokens (or the provider’s effort setting) per feature, and track output tokens per credit so you notice when a model update makes the same feature chattier.
A smaller one, while we’re here: prices change, and so do models. If you let customers choose a model, map each model to its own credit cost, so switching your default from Sonnet to Opus doesn’t quietly drop your margin from 75% to 50% overnight.
How this maps to Kelviq
This is what we built Kelviq for, so briefly: Kelviq meters tokens, API calls and custom units as you report them, with zero metering or ingestion fees. You can sell credits (including rollover credits), a plan with pay as you go usage on top (billed monthly), or a fixed price plus overages. Each customer’s usage against their limit is on their page in the dashboard, and usage alerts fire at the thresholds you set, so the “why did I burn 600 credits” question has an answer. And because Kelviq is the merchant of record, the VAT on that $10 credit pack is our problem, not yours.
Final thoughts
Price the unit of work, not the token. Work out what one request really costs you, with caching, then round up to a number a customer can hold in their head.
If you’re stuck on the numbers for your own product, email me at alok@kelviq.com or message me on LinkedIn and I’ll go through it with you. Happy to help either way. I’ll write up the customer-facing side (how to show usage without making people anxious) in a follow-up post.

