You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,24 @@ result = call_llm("Hello", tokens=100)
59
59
>```
60
60
> The key (e.g. `cyc_live_abc123...`) is shown only once — save it immediately. For key rotation and lifecycle details, see [API Key Management](https://runcycles.io/how-to/api-key-management-in-cycles).
61
61
62
+
### Budget lifecycle
63
+
64
+
The `@cycles` decorator wraps your functionin a reserve → execute → commit/release lifecycle:
65
+
66
+
| Scenario | Outcome | Detail |
67
+
|---|---|---|
68
+
| Reservation denied |**Neither**|`BudgetExceededError`, `OverdraftLimitExceededError`, or `DebtOutstandingError` raised;functionnever executes |
69
+
|`dry_run=True`, any decision |**Neither**| Returns `DryRunResult` or raises; no real reservation created |
70
+
| Function returns successfully |**Commit**| Actual amount charged; unused remainder auto-released |
71
+
| Function raises any exception |**Release**| Full reserved amount returned to budget; exception re-raised |
All raised exceptions from the guarded functiontrigger release. See [How Reserve-Commit Works](https://runcycles.io/protocol/how-reserve-commit-works-in-cycles) for the full protocol-level explanation.
0 commit comments