Wallet #
GET /wallet: current balance, spendable funds, and freeze status.
The wallet endpoint is the cheapest authenticated call in the API. Use it as a smoke test for credentials, as a low-balance alarm, and as a freeze check before submitting jobs.
GET /wallet
GET /walletReturns the wallet for the account that owns the API key used to authenticate the request.
| Method | Path | Auth | Returns |
|---|---|---|---|
GET | /api/v1/wallet | HTTP Basic | 200 OK + WalletStatusResponse |
curl -u "$DD_KEY:$DD_SECRET" \ https://api.datadistillers.com/api/v1/wallet
Response:
{
"balance": 125.40,
"spendable": 119.85,
"is_frozen": false,
"frozen_reason": null
}
| Field | Type | Meaning |
|---|---|---|
balance | number | Total credits deposited and not yet finalised as spend. |
spendable | number | balance minus held funds for in-flight jobs. The amount available to start new jobs. |
is_frozen | boolean | If true, new jobs are rejected with 402. |
frozen_reason | string | null | Human-readable cause when is_frozen. Common values: payment_failed, manual_freeze, compliance_review. |
Use as a credentials smoke test
GET /wallet is the cheapest authenticated endpoint in the API. Pair it
with a CI check or deploy hook to fail fast on broken credentials:
HTTP=$(curl -s -o /dev/null -w '%{http_code}' \
-u "$DD_KEY:$DD_SECRET" \
https://api.datadistillers.com/api/v1/wallet)
case "$HTTP" in
200) echo "✓ DataDistillers credentials valid";;
401) echo "✗ DataDistillers credentials INVALID"; exit 1;;
*) echo "✗ DataDistillers API returned $HTTP"; exit 1;;
esac
Run this immediately after deploys, after rotating secrets, and from a periodic synthetic monitor.
Low-balance alerting
A 5-minute cron that pages on low spendable balance:
import os, requests
THRESHOLD = 50.00
w = requests.get(
'https://api.datadistillers.com/api/v1/wallet',
auth=(os.environ['DD_KEY'], os.environ['DD_SECRET']),
).json()
if w['is_frozen']:
page(f"DD wallet frozen: {w['frozen_reason']}")
elif w['spendable'] < THRESHOLD:
warn(f"DD spendable balance low: ${w['spendable']:.2f}")
For a billing dashboard, pair the wallet endpoint with
GET /usage to show "balance now" alongside
"spend over the last 30 days."
Spendable vs balance
The gap between balance and spendable is the sum of holds for in-flight
jobs. Holds are estimates; actual cost is usually less. After all in-flight
jobs settle, spendable rises back toward balance (less the actually-spent
portion).
A persistent gap that never closes usually means jobs are stuck in
running for unreasonable durations; page on it the same way you would
unrecovered queue depth in your own services.
Errors
| Status | Cause |
|---|---|
401 | Auth credentials missing or invalid. |
429 | Rate limited. |