getBalance
Check your current account balance.
Returns your current AnySolver account balance in USD. The same balance covers every provider.
POST
/getBalanceAuthentication
Pass your AnySolver API key as clientKey in the JSON body. Send Content-Type: application/json.
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
clientKey | string | Yes | Your AnySolver API key (prefix anysolver_). |
Example
{ "clientKey": "YOUR_API_KEY"}curl -X POST https://api.anysolver.com/getBalance \ -H 'Content-Type: application/json' \ -d '{"clientKey":"YOUR_API_KEY"}'const res = await fetch('https://api.anysolver.com/getBalance', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ "clientKey": "YOUR_API_KEY"}),});const data = await res.json();import requestsres = requests.post( 'https://api.anysolver.com/getBalance', json={ "clientKey": "YOUR_API_KEY"},).json()Response body
| Field | Type | Description |
|---|---|---|
errorId | number | 0 on success. See Error IDs for what 1 and 2 mean. |
balance | number | Current balance in USD, with 6 decimal places of precision. |
Example
{
"errorId": 0,
"balance": 12.5
}Errors
| Error code | Cause | Fix |
|---|---|---|
ERROR_KEY_DOES_NOT_EXIST | API key invalid or missing. | Check the key in API Keys. |
Full list: Error handling.
Notes
- Responses always return HTTP 200. Branch on
errorId, not the HTTP status. - The balance is shared across providers. Task costs are estimated at
createTasktime, then reconciled when the task completes. See Pricing & Billing. - Failed tasks are refunded automatically.