# Credits and max_credits

URL: https://docs.sigment.ai/guides/credits-and-max-credits

What costs credits, how agents quote first, and how max_credits caps every paid call.

Paid tools spend the workspace's credits. Reads, lists, searches and sharing are free.

| Action | Tool | Cost |
|---|---|---|
| Discovery (per topic) | `discover_creators` | 20, or free if the same topic ran in the last 24 hours |
| New analysis | `analyze_creators` | 15 |
| Re-analysis (same creators within 30 days) | `analyze_creators`, `run_analysis` | 5 |
| Optimization | `optimize_selection` | 5 |

## Quote, then cap

1. Call `quote_cost` with the action. It returns the price and whether the balance covers it.
2. Pass `max_credits` to the paid tool. If the price is above it, the tool **doesn't start** and charges nothing:

```txt
Not started: this costs 20 credits, above max_credits=10. Ask the user whether to spend 20 credits; do not raise max_credits …
```

Agents should ask the user rather than retry with a higher `max_credits`.

## Charges and refunds

- Paid results include `credits` with what was charged and the remaining balance.
- An analysis is charged when its scrape finishes. Failed paid work is refunded.
- `get_credit_history` lists charges, refunds and top-ups.

## Out of credits

Agents can't pay. When the balance is short, the tool says so and the agent should call `get_topup_link` and give the link to the user.

## Daily agent cap

Agents can spend at most **200 credits per workspace per UTC day**, whatever the balance. `get_account` shows today's agent spend. Past the cap, paid tools refuse until midnight UTC; the user can keep working in the Sigment app.
