Documentation Index
Fetch the complete documentation index at: https://docs.roughy.ai/llms.txt
Use this file to discover all available pages before exploring further.
Quote → token → charge
Roughy uses a two-step pricing flow that guarantees the price you see at quote time is the price you pay:POST /api/v1/pipelines/estimatereturns a price breakdown plus a signedpricing_token(HS256 JWT, 5-minute TTL). The token encodes your user ID, the total credits, and a hash of the pipeline shape.POST /api/v1/pipelinesrequires the token. The server re-verifies the signature and the shape hash, then reserves the quoted credits as a hold against your balance.
Holds, commits, releases
A pipeline run touches the ledger at well-defined moments:| Entry type | When it’s written |
|---|---|
HOLD | At pipeline create — reserves the quoted credits. |
COMMIT | Per step, as the step completes — converts a portion of the hold into a charge. |
RELEASE | At pipeline cancel or finish — releases any unused portion of the hold. |
REFUND | Manual operator action when a run is judged at fault. |
TOPUP | Stripe checkout / portal credits land here. |
EXPIRY | Time-based expiry of stale entries. |
ADJUSTMENT | Manual corrections. |
total_credits_reserved minus
total_credits_consumed equals what’s still held.
Reading the ledger
GET /api/v1/credits/balance— current available balance, the total currently held, and a per-pipeline breakdown of those holds.GET /api/v1/credits/history— paginated ledger of every entry, most recent first.limit+offsetto page.
Topping up
Credit purchases go through Stripe — checkout sessions and customer-portal links are exposed via the billing endpoints in the API Reference. Successful payments land asTOPUP entries in the ledger.
Related concepts
- Pipeline — every pipeline run touches the ledger.