Account
Credits
Read the workspace's credit balance, get the live price of a call before making it, and page through the credit history.
This edition is written for AI agents: complete, explicit and ready to paste. Give it to your agent, or point the agent at its address and it reads the page itself.
# Credits
> Read the workspace's credit balance, get the live price of a call before making it, and page through the credit history.
- Human-readable page: https://dashboard.sproutsdata.ai/docs/api-reference/credits
- This document: https://dashboard.sproutsdata.ai/docs/agents/api-reference/credits
- Index of every agent document: https://dashboard.sproutsdata.ai/llms.txt
- API base URL: https://api.sproutsdata.ai
## Summary
Three free routes read the workspace's credits: `GET /v1/credits` (balance), `POST /v1/credits/quote` (the live price of a call before making it) and `GET /v1/credits/transactions` (the ledger). Credits cannot be bought through the API; buying happens in the dashboard (`/credits`).
## Rules
- Free. Scope `dsp.usage.read`.
- `GET /v1/credits`: `balance` (negative while in debt), `reserved` (held for work in progress), `available` (spendable now), `debt` (repaid first), `status` (`active` or `frozen`), `has_paid` (the workspace has bought credits at least once; decides whole-record access in lists and exports), `rate_card`, `stale` (`true`: the ledger was unreachable and these are the last figures read).
- `status: "frozen"`: calls that spend credits answer 402 `credits.wallet_frozen`.
- `POST /v1/credits/quote` holds and spends nothing. `operation` (required): `search` (fast), `search_auto`, `similar`, `relationships`, `institutions`, `lookup`, `org_chart`, `agent_run`, `enrichment`.
- `rows` (default 10): rows on the page for paged operations (up to 100); records found for `lookup` (up to 1,000); for `enrichment`, records when `fields` is given (up to 10,000), else values at one price (up to 30,000). Ignored by flat operations and agent runs.
- `start` (default 0): rows of the same search already paid for; only rows beyond are charged.
- `effort`: required for `agent_run`.
- `fields`: `enrichment` only (`EMAIL`, `PHONE`, `DOMAIN`, `LINKEDIN_URL`).
- An enrichment quote over 30,000 credits is refused, as the job would be.
- Answer: `credits`, `basis` (`page`, `records`, `call`, `run`, `run_up_to`, `values_up_to`), `rate_card`, `available` and `covered` (from the last balance read; `null` when unknown).
- Quote before an expensive call (agent runs at high effort, large enrichment jobs) instead of guessing.
- `GET /v1/credits/transactions`: newest first; query `cursor` and `limit` (default 50, max 100). Stop when `next_cursor` is null.
## Operations
### GET /v1/credits
The workspace's credits
- URL: `GET https://api.sproutsdata.ai/v1/credits`
- Scopes (any one): `dsp.usage.read`
- Cost: free
Response 200 (application/json): Successful Response
Response fields:
- `available` (number, required): What can be spent now.
- `balance` (number, required): Credits in the wallet (negative while in debt).
- `debt` (number, required): Owed after a refund or dispute; repaid first.
- `has_paid` (boolean, required): Whether the workspace has ever bought credits.
- `rate_card` (string, required): The price list calls are charged by.
- `reserved` (number, required): Held for work in progress (agent runs).
- `status` (string, required): `active`, or `frozen` by Sprouts staff.
- `stale` (boolean): The ledger could not be reached: this is the last balance read, and may be behind. Default `false`.
Errors:
- 401: No credential, or one that does not verify (`auth.unauthorized`).
- 403: The credential lacks the scope this route needs (`auth.insufficient_scope`), or the signed-in user has not chosen a workspace (`auth.workspace_required`).
- 503: A service this request needs is unavailable, or the API is at capacity. See `Retry-After`.
Example request:
```bash
curl "https://api.sproutsdata.ai/v1/credits" \
-H "X-API-Key: $SPROUTS_API_KEY"
```
### POST /v1/credits/quote
What a call would cost, from the live price list
- URL: `POST https://api.sproutsdata.ai/v1/credits/quote`
- Scopes (any one): `dsp.usage.read`
- Cost: free
Holds nothing and costs nothing. `available` and `covered` are from the balance read
moments ago, when there is one; a quote never waits on the ledger.
Request body (JSON, required):
- `operation` (string, required): The billable calls, named for what a caller does. One of: `"search"`, `"search_auto"`, `"similar"`, `"relationships"`, `"institutions"`, `"lookup"`, `"org_chart"`, `"agent_run"`, `"enrichment"`.
- `effort` (string or null): `agent_run` only, and required for it. The earlier names (`minimal`, `low`, `medium`, `high`, `xhigh`) are still accepted. One of: `"quick"`, `"basic"`, `"standard"`, `"detailed"`, `"maximum"`, `"auto"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`.
- `fields` (array of string or null): `enrichment` only: the fields asked for each of `rows` records. The quote is then every one of them found, each field at its own price (a phone number costs more than an email). One of: `"EMAIL"`, `"PHONE"`, `"DOMAIN"`, `"LINKEDIN_URL"`. Limits: 1 to 4 items.
- `rows` (integer): Rows on the page (paged operations, up to 100), records found (`lookup`, up to 1,000), or for `enrichment`: records when `fields` is given (up to 10,000, a job's most), else values at one price (up to 30,000). Ignored by flat operations and agent runs. An enrichment quote over 30,000 credits is refused, as the job would be. Default `10`. Limits: 0 to 30000.
- `start` (integer): Rows of the same search already paid for (the next page's offset): only the rows beyond them are charged. Default `0`. Limits: 0 to 100000.
Response 200 (application/json): Successful Response
Response fields:
- `basis` (string, required): `page`: these rows of a search; `records`: per record found; `call`: flat, whatever it returns; `run`: an agent run at that effort; `run_up_to`: `auto` holds this much and is charged at the effort it chooses; `values_up_to`: enrichment holds this much (every value asked for) and is charged only for the values newly found. One of: `"page"`, `"records"`, `"call"`, `"run"`, `"run_up_to"`, `"values_up_to"`.
- `credits` (number, required): What the call would be charged, in credits.
- `operation` (string, required): The billable calls, named for what a caller does. One of: `"search"`, `"search_auto"`, `"similar"`, `"relationships"`, `"institutions"`, `"lookup"`, `"org_chart"`, `"agent_run"`, `"enrichment"`.
- `rate_card` (string, required): The price list this quote is from.
- `available` (number or null): What the workspace can spend now, in credits; `null` when not known.
- `covered` (boolean or null): Whether `available` covers this quote; `null` when not known.
Errors:
- 401: No credential, or one that does not verify (`auth.unauthorized`).
- 403: The credential lacks the scope this route needs (`auth.insufficient_scope`), or the signed-in user has not chosen a workspace (`auth.workspace_required`).
- 422: The request is invalid (`request.invalid`), or its cursor is (`pagination.*`).
Example request:
```bash
curl -X POST "https://api.sproutsdata.ai/v1/credits/quote" \
-H "X-API-Key: $SPROUTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"operation": "search",
"rows": 50
}'
```
### GET /v1/credits/transactions
The workspace's credit history, newest first
- URL: `GET https://api.sproutsdata.ai/v1/credits/transactions`
- Scopes (any one): `dsp.usage.read`
- Cost: free
Query parameters:
- `limit` (integer): Default `50`. Limits: 1 to 100.
- `cursor` (string or null): Limits: at most 500 characters.
Response 200 (application/json): Successful Response
Response fields:
- `results` (array of object, required)
- `balance_after` (number, required)
- `created_at` (string, required)
- `credits` (number, required): Signed: + credits in, - credits spent.
- `id` (string, required)
- `kind` (string, required)
- `action` (string or null)
- `source` (string or null): For grants: `signup`, `referral`, ...
- `next_cursor` (string or null)
Errors:
- 401: No credential, or one that does not verify (`auth.unauthorized`).
- 403: The credential lacks the scope this route needs (`auth.insufficient_scope`), or the signed-in user has not chosen a workspace (`auth.workspace_required`).
- 422: Validation Error
- 503: A service this request needs is unavailable, or the API is at capacity. See `Retry-After`.
Example request:
```bash
curl "https://api.sproutsdata.ai/v1/credits/transactions?limit=20" \
-H "X-API-Key: $SPROUTS_API_KEY"
```
## See also
- https://dashboard.sproutsdata.ai/docs/agents/guides/credits
- https://dashboard.sproutsdata.ai/docs/agents/guides/credits/balance-and-spend
- https://dashboard.sproutsdata.ai/docs/agents/guides/credits/buying-credits
- https://dashboard.sproutsdata.ai/docs/agents/api-reference/usage-history