Skip to Content
Peak Solutions

Balance

GET /balance returns what your API key can spend.

GET https://api.peak.fo/balance

Returns your balance, or what's left on your package. It's free, so it's also the easiest way to check that a key works.

Request

HeaderValue
X-API-KeyYour API key.
Terminal
curl https://api.peak.fo/balance \
  -H "X-API-Key: pk_your_api_key"

For examples in Python, JavaScript and Go, see Authentication.

Response

The fields in data depend on how the key is billed.

Pay-per-solve key. Each successful solve is taken from your balance.

FieldTypeDescription
data.typestringpay_per_solve
data.balancenumberYour account balance, in USD.

Package key. Solves come out of the package instead of your balance.

FieldTypeDescription
data.typestringpackage
data.package_namestringThe package's name.
data.remaining_solvesnumberSolves left.
data.total_solvesnumberSolves the package started with.
data.allowed_tasksstring[]The task_type values this key can solve, or ["all"]. A Turnstile package covers both Turnstile task types.
data.expires_atstringWhen the package expires, as an ISO 8601 time.
data.days_remainingnumberWhole days until it expires.
{
  "success": true,
  "data": {
    "type": "pay_per_solve",
    "balance": 12.5
  }
}

Errors

error_codeHTTPWhat to do
missing_api_key401Send the key in the X-API-Key header.
invalid_api_key401Check for typos, or copy the key again from the dashboard.
api_key_inactive401The key was turned off, or its package expired or ran out.
account_suspended401Your account is suspended. Contact support.
auth_error401We couldn't check the key. Retry.
internal_error500Something went wrong on our side. Retry.

On this page