LeadRefinery — How the Platform Works

Cost and reconciliation

Traced at commit ffe4e48 · apps/dry-run-api/src/app/simulation/script-builder.ts (product prices) · libs/db/src/schema/tenant-config.ts · apps/api/src/app/observability/db-gauges.service.ts

Summary

  1. The voice provider bills a call as separate products.
  2. Each product has a price per second.
  3. On production, one minute of call costs about $0.157 on average. That is about a quarter of a cent per second.
  4. The carrier bills separately for the telephone leg.
  5. The platform writes each cost into its own spend ledger.
  6. A recurring check compares the voice provider's own price for each call with the ledger.
  7. Business figures multiply observed volumes by two constants from the client.
  8. Every client record says whether those constants are real or estimated.
A call is billed as separate products, each priced per second. The diagram shows seven products and about half a cent per second; those were the rehearsal simulator's old figures. A production call is billed as four products and costs about a quarter of a cent per second. The carrier bills separately for the telephone leg. Three records describe the same call: the voice provider's invoice, the carrier's invoice and the platform's own attempt record, and a recurring check compares them. Business figures multiply observed volumes by two constants each client supplies once, and each client record says whether those constants are real or estimated.
Workflow 1 of 2 — the price of a call. Separate products, each per second. Duration decides the cost. The diagram shows the simulator's old seven-product price; the text below gives the production figures.

Workflow 1 — the price of one call

  1. The voice provider bills a production call as 4 products.
  2. The voice engine is 35.5% of the cost, about $0.055 per minute.
  3. The language model is 35.3% of the cost, about $0.045 per minute.
  4. A long-prompt token surcharge is 19.2% of the cost, about $0.06 per minute. It applies because the agent's prompt is over 4,000 tokens.
  5. Speech synthesis is 9.7% of the cost, about $0.015 per minute.
  6. Each product has a price per second.
  7. On production, the products total about $0.157 per talk minute on average, between $0.115 and $0.194.
  8. An answered call lasts 29 seconds on average and costs about $0.076.
  9. The voice provider bills at least 10 seconds when the agent speaks first.
  10. Duration therefore decides the cost of a call.
  11. The carrier bills the telephone leg separately, at about $0.009 for each answered call.
  12. The rehearsal simulator now prices at the production rate, 0.2916667 cents per second (about $0.175 per minute). Its product lines add up to its total.

Updated 26 October 2026. The team measured the figures above on 538 production calls, 9 to 22 October 2026. The old figure of 0.5028846 per second was the simulator's own constant, in cents: $0.30 per minute.

Workflow 2 — reconciliation

Three separate records describe the same call: the voice provider's price, the carrier's detail record, and the platform's own record. A reading of zero has two meanings that look identical on a dashboard: either the records agree, or a record is missing so nothing can disagree. The diagram predates the spend ledger; the text below describes the check that runs today.
Workflow 2 of 2 — reconciliation. A zero has two meanings and they look the same. Confirm which one before you trust it. The text below describes the check that runs today.
  1. The voice provider prices each call that the platform places.
  2. The platform writes that price into its spend ledger (the table spend_ledger).
  3. The ledger also holds the carrier's call legs, call control and text messages. A job reads them from the carrier's detail records every hour. Those entries arrive a few hours late.
  4. The ledger also holds each request to the post-call analysis model, at list price.
  5. Every 15 minutes, a check reads the voice provider's own price for each call in the last 48 hours. It compares that price with the ledger.
  6. The Grafana panel “Retell bill vs our ledger (48h)” shows the result.
  7. A difference is a finding. It is not a rounding error.

Updated 26 October 2026. The earlier check compared a record with itself, so it could never find a difference. The check above replaces it.

Read a reconciliation of zero carefully. Zero means that the records agree, or that no record exists to disagree with. Those are different states and the number looks the same. Confirm which one you are reading before you trust it.

Business figures

  1. Each client supplies two constants once.
  2. The first constant is the value of a funded deal.
  3. The second constant is the hourly cost of a human caller.
  4. The platform multiplies those constants by volumes it observes.
  5. The results are pipeline created, hours saved, cost per booking and return on spend.
  6. Each client record carries the field economics_source.
  7. That field says whether the constants are real or estimated.
  8. 5 of 7 clients currently say estimated. Both live clients are among them.

Cautions

  1. Production now has priced real calls. Their cost comes from the voice provider's own price for each call.
  2. Rehearsal traffic is still priced by a constant in the simulator. No provider bills the platform for it.
  3. Treat a rehearsal currency figure as a check of the calculation, not as a spend figure.
  4. The ledger does not record number rent, number reputation lookups, hosting, the do-not-call list subscription or the email service.
  5. See Observability for which numbers are rehearsal traffic.

A call from start to end — where the duration that decides the cost comes from.