QuantSet Docs Developer console

Credit caps and receipts

Set a ceiling on what a request can spend and reconcile the settled charge from its receipt.

How a request is priced

The active rate card lists the billing unit for every operation. Settlement measures the records actually delivered. Read included_units, block_size and rounding from the active rule to see how those records become credits. On the initial card, a page of 200 daily bars settles at one credit and a page of 251 settles at two. The macro series catalog remains free discovery. Historical macro observations and FX reads use their published tariff.

Enforce a credit limit

curl "https://api.quantset.dev/api/v1/prices?ticker=NVDA&limit=251" \
  -H "X-API-Key: $QUANTSET_API_KEY" \
  -H 'X-Max-Credits: 2' -H 'X-Workflow-Id: research-session-1' -i

A metered request that exceeds X-Max-Credits returns 422 credit_budget_exceeded and charges zero. If a wallet cannot fund the request, 402 insufficient_credits reports credits_remaining and either the exact required_credits or a maximum_credits ceiling. When supplied, affordable_page names a smaller limit and value that fits your budget. Choose a smaller page or top up before retrying. Request-rate limits use 429 and Retry-After.

Read the receipt

X-Credit-Cost is the settled charge. X-Credits-Remaining is the spendable wallet balance when supplied. Store X-Request-Id and X-Rate-Card-Version to reconcile the call with account usage. The same logical query uses the same tariff for JSON and CSV. Cursors retain the billing version for their continuation.

Cap an MCP or SDK workflow

Pass max_credits to an MCP data tool and inspect _meta.credit_cost on its result. The remote tool can also accept X-Max-Credits on the transport; the tighter ceiling applies.

For multi-page prices, the Python SDK accepts credit_budget and JavaScript accepts creditBudget alongside the maximum number of pages. Both send the remaining budget on each call and expose per-page receipts. See SDK setup and pagination.