# Billing

Billing is workspace-based. Only an `active` paid subscription grants paid quotas; non-active statuses stay on free limits.

## Metered surfaces

- Developer API calls.
- MCP tool calls.
- RAG tool calls.
- Runtime LLM provider streams.
- Runtime LLM tokens.
- Workspace document storage.

## Runtime LLM

Runtime LLM quotas count provider streams, not user messages. A tool loop can use two or more runtime requests: initial answer, provider round after tool results, final answer.

Tokens are recorded after each provider stream as input/output delta for that round. Providers may report usage on final finish data or on step finish data; loqy normalizes both.

## Errors

- Quota reached: `429 quota_exceeded`; do not retry until `resetAt` or a plan change.
- Billing lookup unavailable: `503 billing_unavailable`; retry later.
- Short-window rate limits also use `429` and include `Retry-After`.

Quota-blocked runtime requests stop before the model provider is called.
