Skip to content

Estimate refused requests at the cost Anthropic bills #489

Open

Description

@hakula139

Goal

The session cost estimate counts every request with usage reported by the API, including refused requests. Under Anthropic's refusal billing rules, a refusal that arrives before any output is billed only for some policy categories (bio, frontier_llm, and reasoning_extraction at the time of writing). Other categories and refusals without a category incur no charge, so the estimate overstates the cost of those refusals. Decide whether the estimate should follow these rules, since Anthropic says the billed categories may change.

Acceptance criteria

  • Record the decision in the session cost section of docs/design/session/persistence.md.
  • If the estimate follows the rules, refusals before any output in unbilled categories add nothing to the session total. Add a test covering a billed and an unbilled category.

Notes

TurnReport::record collects usage for each round, and Engine::roll_back (#475) bills the rounds of a refused turn.

Activity

  1. added
    enhancement
    area: engine
    on Oct 21, 2026
  2. self-assigned this
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: engineenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions