Balance API
The prepaid balance and what is held for tasks in progress.
Every operation of the API reference is generated from the contract the API serves, version 0.1.0. Replace YOUR_API_KEY in the samples with your key; each response shows an example in the contract's shape.
Get the balance
/v1/balanceAuthentication. Your API key, as a bearer token: Authorization: Bearer YOUR_API_KEY.
The available balance and what is held for tasks in progress.
Responses
| Status | What it means |
|---|---|
| 200 OK | The balance. Balance (application/json) |
| 429 Too Many Requests | Over a budget for reading ( Problem (application/problem+json) |
| Any other status | An error, as RFC 9457 problem details. Problem (application/problem+json) |
Error codes
The errors reference says what each means, whether a retry helps and what it costs.
Request
curl https://api.zerocaptcha.io/v1/balance \ -H "Authorization: Bearer YOUR_API_KEY"const response = await fetch("https://api.zerocaptcha.io/v1/balance", { headers: { Authorization: "Bearer YOUR_API_KEY", },});console.log(response.status, await response.text());import requests
response = requests.get( "https://api.zerocaptcha.io/v1/balance", headers={"Authorization": "Bearer YOUR_API_KEY"}, timeout=30,)print(response.status_code, response.text)Response
{
"available": "0.000400",
"currency": "USD",
"held": "0.000000"
}rate_limited
{
"type": "https://zerocaptcha.io/docs/reference/errors/#rate_limited",
"title": "Too many requests",
"status": 429,
"instance": "/v1/balance",
"code": "rate_limited",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}unauthorized
{
"type": "https://zerocaptcha.io/docs/reference/errors/#unauthorized",
"title": "Authentication required",
"status": 401,
"instance": "/v1/balance",
"code": "unauthorized",
"request_id": "0192f3a4-7b1c-7d2e-9f10-3c4d5e6f7a8b"
}Example values in the contract's shape, version 0.1.0.