/api/v1/billing/quotaPurchase additional REQUEST quota by debiting the USD `credit_balance` wallet at 100 requests per $1.
Purchase additional REQUEST quota by debiting the USD `credit_balance` wallet at 100 requests per $1. EXEMPT (`cost: 0`). Logs a SPEND `Transaction`. Returns 400 with `INSUFFICIENT_BALANCE` when the wallet does not cover the requested amount.
Why use this
Common use case
Customer-initiated request-quota top-up. EXEMPT (cost: 0). Debits the USD credit_balance wallet (in DOLLARS) and adds REQUESTS to user_plans.total_limit_api at the fixed exchange rate of 100 requests per $1. Atomic — wallet debit + quota credit + SPEND Transaction row commit together (no half-state on partial failure). Returns 400 with INSUFFICIENT_BALANCE when credit_balance < amount_dollars; gate the UI button by checking GET /api/v1/user/ credit_balance first. To fill the wallet before calling this, use POST /api/v1/payments/create-intent (one-time top-up via Stripe). Note this is the LEGACY per-request meter — NOT the canonical Phase 56 token meter (GET /api/v1/account/balance). The token meter has its own monthly-cycle refill model and does NOT currently support customer-initiated top-up; on a paid plan it refills to 200,000 tokens at the subscription anniversary.
Parameters
| Name | In | Required | Default | Allowed | Description | Example |
|---|---|---|---|---|---|---|
| amount_dollars | body | required | — | — | USD amount to spend (NOT cents). Positive number; integer or float (e.g. 10, 20, 12.50). Validated server-side: rejected with 400 `BAD_REQUEST` on missing/non-numeric/zero/negative; rejected with 400 `INSUFFICIENT_BALANCE` if `users.credit_balance < amount_dollars`. Each $1 buys 100 REQUESTS. | 10 |
Response schema
| Field | Type | Nullable | Description |
|---|---|---|---|
| status | string | no | ApiResponse envelope status — `success` on 200, `error` on 4xx/5xx. |
| request_id | string | yes | Per-request correlation ID. |
| timestamp | string | no | ISO-8601 UTC timestamp. |
| data | object | no | Post-purchase result payload. |
| data.message | string | no | Human-readable confirmation (e.g. `Successfully purchased 1000 additional API requests.`). Use for the UI success toast. |
| data.new_total_limit | integer | no | Post-purchase value of `user_plans.total_limit_api` (in REQUESTS, not tokens). Mirrors the legacy per-request quota; the new bonus quota is added on top of the plan's base allocation. Use to update the 'Total requests' progress-bar denominator client-side without a separate /api/v1/billing/subscription call. |
| data.new_balance | number | no | Post-purchase USD wallet balance (`users.credit_balance`). NOT in cents — server returns `float(credit_balance)`. Use to update the 'Wallet balance' chip client-side. |
Sample response
- "status": "success"
- "request_id": "req_3OqK2jK9L8pQ4xZ5"
- "timestamp": "2026-05-02T15:51:00.000Z"
- "data":
- "message": "Successfully purchased 1000 additional API requests."
- "new_total_limit": 1100
- "new_balance": 2.5
Errors
| Status | Label | Description |
|---|---|---|
| 200 | OK | Request succeeded. |
| 400 | Bad Request | Invalid query, body, or path parameter. |
| 401 | Unauthorized | Missing or invalid Authorization header / api_Token. |
| 402 | Payment Required | Insufficient token balance for this call. Top up |
| 429 | Too Many Requests | Rate limit exceeded for your tier (see /pricing for tier limits). Tier limits |
| 500 | Server Error | Unexpected server-side failure. Retry with backoff; report if persistent. |
Code samples
curl -X POST "https://api.finradar.ai/api/v1/billing/quota" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Generate an API key in /account/credentials to run live queries (literal YOUR_API_KEY placeholder shown until then).