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
| Field | Type | Required | Description |
|---|---|---|---|
clientKey* | string | Yes | Your API key. Create one in the AnySolver dashboard. |
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 | Required | Description |
|---|---|---|---|
errorId* | Yes | 0 = success, 1 = external error, 2 = internal error. | |
errorCode | No | Machine-readable error code. | |
errorDescription | string | No | Human-readable error message with resolution hints. |
balance | number | No | Account balance in USD. |
Examples
{ "errorId": 0, "balance": 12.5}{ "errorId": 1, "errorCode": "ERROR_KEY_DOES_NOT_EXIST", "errorDescription": "Invalid or missing API key. Check your dashboard for the correct key."}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.