> ## Documentation Index
> Fetch the complete documentation index at: https://tfstudio.truefan.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Credits & Billing

> How generations are priced and charged

## Pricing

Every template has an `estimated_credits` cost, set when it's saved. A request costs `template.estimated_credits × row_count` — for a single video, that's just `template.estimated_credits`.

You never send a cost figure in a request — it's always computed server-side from the template itself, so a caller can't under-report their own cost.

## When credits are charged

Credits are deducted **before** rendering starts, at the moment a request is accepted (the `202 Accepted` response).

## Insufficient credits

If the workspace's account doesn't have enough balance, the request is rejected before anything is created or dispatched:

```json theme={null}
{
  "error": "insufficient_credits",
  "required": "0.68",
  "available": "0.20"
}
```

<ResponseField name="status" type="402 Payment Required" />

## Attribution

Every charge is tagged with both the workspace and the specific API key that made the request. This means you can see exactly which integration — a Zapier flow, an internal script, a customer-facing feature — is driving spend, even when a workspace has multiple keys in active use.

## Which account gets charged

Credits are always deducted from the **workspace's** account — the same shared pool the dashboard draws from — not from any individual user's personal balance. Any active member's API key spends against the same pool any other member's dashboard actions would.
