Account
Credits
Read the workspace's credit balance, get the live price of a call before making it, and page through the credit history.
These routes read the workspace's credits: the balance and what is held for work in progress, the price of a call before you make it, and every credit movement. All three are free. Credits are bought in the dashboard on the Credits page, not through the API. See Credits and usage.
Get the balance#
GEThttps://api.sproutsdata.ai/v1/credits
- Scope
- dsp.usage.read
- Cost
- Free
Response 200application/json
availablenumberrequiredWhat can be spent now.
balancenumberrequiredCredits in the wallet (negative while in debt).
debtnumberrequiredOwed after a refund or dispute; repaid first.
has_paidbooleanrequiredWhether the workspace has ever bought credits.
rate_cardstringrequiredThe price list calls are charged by.
reservednumberrequiredHeld for work in progress (agent runs).
statusstringrequiredactive, orfrozenby Sprouts staff.stalebooleandefaultfalseThe ledger could not be reached: this is the last balance read, and may be behind.
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.
curl "https://api.sproutsdata.ai/v1/credits" \
-H "X-API-Key: $SPROUTS_API_KEY"{
"available": 0,
"balance": 0,
"debt": 0,
"has_paid": false,
"rate_card": "string",
"reserved": 0,
"stale": false,
"status": "string"
}Quote a call#
POSThttps://api.sproutsdata.ai/v1/credits/quote
- Scope
- 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 bodyJSON, required
operationstringrequiredThe billable calls, named for what a caller does.
"search""search_auto""similar""relationships""institutions""lookup""org_chart""agent_run""enrichment"effortstring or nullagent_runonly, and required for it. The earlier names (minimal,low,medium,high,xhigh) are still accepted."quick""basic""standard""detailed""maximum""auto""minimal""low""medium""high""xhigh"fieldsarray of string or null1 to 4 itemsenrichmentonly: the fields asked for each ofrowsrecords. The quote is then every one of them found, each field at its own price (a phone number costs more than an email)."EMAIL""PHONE""DOMAIN""LINKEDIN_URL"rowsintegerdefault100 to 30000Rows on the page (paged operations, up to 100), records found (
lookup, up to 1,000), or forenrichment: records whenfieldsis 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.startintegerdefault00 to 100000Rows of the same search already paid for (the next page's offset): only the rows beyond them are charged.
Response 200application/json
basisstringrequiredpage: these rows of a search;records: per record found;call: flat, whatever it returns;run: an agent run at that effort;run_up_to:autoholds 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."page""records""call""run""run_up_to""values_up_to"creditsnumberrequiredWhat the call would be charged, in credits.
operationstringrequiredThe billable calls, named for what a caller does.
"search""search_auto""similar""relationships""institutions""lookup""org_chart""agent_run""enrichment"rate_cardstringrequiredThe price list this quote is from.
availablenumber or nullWhat the workspace can spend now, in credits;
nullwhen not known.coveredboolean or nullWhether
availablecovers this quote;nullwhen 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.*).
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
}'{
"available": 0,
"basis": "page",
"covered": false,
"credits": 0,
"operation": "search",
"rate_card": "string"
}List credit transactions#
GEThttps://api.sproutsdata.ai/v1/credits/transactions
- Scope
- dsp.usage.read
- Cost
- Free
Query parameters
limitintegerdefault501 to 100cursorstring or nullat most 500 characters
Response 200application/json
resultsarray of objectrequired7 fields inside
balance_afternumberrequiredcreated_atstringrequiredcreditsnumberrequiredSigned: + credits in, - credits spent.
idstringrequiredkindstringrequiredactionstring or nullsourcestring or nullFor grants:
signup,referral, ...
next_cursorstring 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.
curl "https://api.sproutsdata.ai/v1/credits/transactions?limit=20" \
-H "X-API-Key: $SPROUTS_API_KEY"{
"next_cursor": "string",
"results": [
{
"action": "string",
"balance_after": 0,
"created_at": "string",
"credits": 0,
"id": "string",
"kind": "string",
"source": "string"
}
]
}Balance, held and available#
balance is what the wallet holds. reserved is held for work still running, such as an agent run, and available is what can be spent now. debt, if any, is repaid first. A status of frozen means calls that spend credits are refused with 402 credits.wallet_frozen. When stale is true, the ledger could not be reached and the figures are the last ones read.
Quotes#
A quote prices one call from the live price list without holding or spending anything. Name the call with operation and describe its size: rows for a page of results, records found or enrichment values, start for a later page of the same search (only rows beyond it are charged), effort for an agent run, and fields for enrichment. basis says how the price is counted, and covered whether the balance available covers it. For example, {"operation": "search", "rows": 50} prices a 50-row fast search page. See Balance and spend.