DocsAPI ReferenceBalance
Balance
Check your account balance
GET
https://api.scarnox.com/api/balanceRequires Authorization: Bearer <api_key>
Returns your current USD balance. Use this to check remaining credits programmatically. Balance is only deducted on solved tasks — failed solves are free.
Request
http
GET https:/api/balance HTTP/1.1
Authorization: Bearer scarnox_YOURAPIKEYResponse
json
{
"balance": 0.9940,
"currency": "USD"
}Python Example
python
import requests
resp = requests.get(
'https://api.scarnox.com/api/balance',
headers={'Authorization': 'Bearer scarnox_YOURAPIKEY'},
)
data = resp.json()
print("Balance: $%.4f" % data['balance'])Solve Response Fields
Every POST /api/tasks/create response also includes:
challenge_typestringalwaysType of challenge solved (e.g. image_label_binary)
time_takennumberalwaysSeconds the solver spent on this task
cost_chargednumberalwaysAmount deducted this request (0 if failed)
balance_remainingnumberalwaysYour balance after this request
json
{
"success": true,
"id": "scrx_...",
"status": "solved",
"token": "P1_eyJ...",
"site_url": "https://example.com",
"site_key": "your-sitekey",
"challenge_type": "image_label_binary",
"time_taken": 7.94,
"solve_time_ms": 7940,
"cost_charged": 0.00069,
"balance_remaining": 9.99925
}