Token Cost Estimates
Every AI operation in Proseweave consumes tokens from your balance. The Token Cost Estimate dialog lets you see how many tokens an operation will use before it runs, so you can make informed decisions about your budget.
How It Works
When you click an AI action button (Continue Writing, Generate Scene, Rewrite, etc.), Proseweave:
- Builds the same prompt that the real operation would use.
- Calls the Anthropic token-counting API to measure the exact input size.
- Estimates the output size based on the operation type and historical averages.
- Shows a confirmation dialog with the full breakdown.
You can then Proceed to run the operation or Cancel to back out at no cost.
The Confirmation Dialog
The dialog displays:
| Field | Description |
|---|---|
| Operation | The AI action you triggered |
| Model | Which Claude model will be used, with a cost tier badge ($ / $$ / $$$) |
| Input tokens | Tokens sent to the model (exact count when available) |
| Output tokens | Estimated tokens the model will generate |
| Total estimate | Combined input + output tokens |
| Balance | Your current balance and projected balance after the operation |
Input token counts are exact when the Anthropic counting API is available. If the API is unreachable, Proseweave falls back to a character-based estimate and marks it as (est.).
Pipeline Operations
Some operations run multiple AI steps internally. For example, Generate Scene uses a 2- or 3-step pipeline:
- Expand Beat — turns the scene beat into detailed prose instructions
- Analyze Voice (conditional) — studies your existing prose style
- Generate Prose — writes the scene content
The estimate dialog shows the combined cost of all steps and notes the pipeline:
This operation uses a 3-step pipeline. The estimate includes all steps.
Pipeline estimates include padding for intermediate outputs that can't be measured in advance. Actual costs are typically lower than the estimate.
Prompt Caching
Proseweave uses Anthropic's prompt caching for Story Bible context. When caching is active, the dialog shows a note:
Story Bible context may be cached, reducing actual cost.
Cached tokens cost significantly less than uncached tokens, so your actual usage will often be lower than the estimate.
Insufficient Balance
If your token balance is too low for the estimated cost, the dialog:
- Highlights the projected balance in red
- Shows an Insufficient token balance warning
- Disables the Proceed button
You'll need to add tokens to your balance before running the operation.
Covered Operations
The following operations show a cost estimate before running:
| Location | Operations |
|---|---|
| Manuscript toolbar | Continue Writing, Rewrite Selection |
| Structured Rewrite panel | Structured Rewrite |
| Scene cards (Outline view) | Generate Scene |
| Act cards (Outline view) | Expand Outline, Suggest Act Summary |
| Chapter cards (Outline view) | Suggest Scene Beats |
Low-cost operations like field rewrites and dialogue samples run without a confirmation step to keep the workflow smooth.
Error Handling
If the estimation endpoint fails (network issue, server error), the dialog shows the error message with two options:
- Cancel — abort the operation
- Proceed Anyway — run the operation without knowing the exact cost
This ensures you're never blocked from working, even if cost estimation is temporarily unavailable.