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

# Track and Consume Credits

> Atomically consume credits and queue the matching billing event

**Auth:** secret key only. The customer, Feature, and optional Credit System must belong to the authenticated organization.

```http theme={null}
POST /usage/track
Authorization: Bearer sk_nozle_...
Idempotency-Key: execution_0183f
Content-Type: application/json
```

```json theme={null}
{
  "customer_id": "customer_123",
  "feature_code": "agent_execution",
  "credit_system_code": "ai_credits",
  "properties": {},
  "timestamp": "2026-07-20T12:00:00.750Z"
}
```

A successful response includes the operation ID, exact credits consumed,
remaining total, and source deductions with their balance-source IDs.
Insufficient credits return `allowed=false` without allocations or a
Core event.

Retry HTTP `503` with the same idempotency key. Reusing a key with a different payload returns `409`.

For staged validation and canary guidance, see [Credit Rollout and Acceptance](/guides/credits/rollout).
