---
id: ADR-PFM-LLM-003
title: 'Attempt Settlement With Usage, Estimate or Release'
product_area: platform
module: llm
revision: 1
status: proposed
design_intent: proposed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
decision: >-
  After dispatch, attempt actual settlement for positive reported usage, an estimate for successful unmeasured
  work or zero release, while preserving interruption and persistence limits.
constrains:
  - DOM-PFM-LLM-001
  - DOM-PFM-LLM-003
  - STATE-PFM-LLM-001
  - WF-PFM-LLM-001
origin: >-
  The foundation design section 4.4 states actual and fallback settlement
  (services-platform:docs/llm/llm-foundation-and-generate-query.md#4.4 Accounting Rules); the release when no
  provider answered is the module guide's later choice (services-platform:docs/llm.md#Money), not separately
  approved.
alternatives:
  - option: Estimate-charge every unmeasured outage
    why_not: It repeatedly bills customers for requests that never obtained a provider answer.
  - option: Release all work without reported usage
    why_not: It hides charges for successful conversations whose usage was not measured.
  - option: Charge only successful conversations
    why_not: Failed work can already have consumed billable units.
consequences:
  - Failed conversations can retain charges.
  - Estimate settlement keeps monetary cost unknown rather than asserting zero on the request.
  - Measured admitted usage can exceed allowance after admission.
  - >-
    Cleanup releases after some real usage and can repeat a period release; it is not a complete accounting
    guarantee.
supersedes: []
evidence:
  - >-
    services-platform at ad3f6a6: modules/llm/services/execution/run-operation.ts (settleInvocation, the
    cleanup block); services/persistence/invocations.ts (markInvocationSettled); db/llm-invocations.table.ts
    (LLM_SETTLEMENT_KINDS).
---

# Attempt Settlement With Usage, Estimate or Release

## Context

A provider can report usage, omit it or fail before answering. Request outcomes and accounting outcomes therefore need separate meanings.

## Decision

After dispatch, attempt actual settlement for positive reported usage, an estimate for successful unmeasured work or zero release, while preserving interruption and persistence limits.

## Alternatives Considered

Estimate-charge every unmeasured outage: It repeatedly bills customers for requests that never obtained a provider answer.

Release all work without reported usage: It hides charges for successful conversations whose usage was not measured.

Charge only successful conversations: Failed work can already have consumed billable units.

## Consequences

Failed conversations can retain charges. Estimate settlement keeps monetary cost unknown rather than asserting zero on the request. Measured admitted usage can exceed allowance after admission. Cleanup releases after some real usage and can repeat a period release; it is not a complete accounting guarantee.
