Skip to content

Open platform balance

Description

Query the available credit balance of the current open platform account. Useful for setting balance alerts.

Data notes: Balance data may have a short delay; use the actual API response as the source of truth.

Endpoint

  • Method: GET
  • Path: /open/v1/credit/balance

Credits

  • Cost: 0

Prerequisites

  • Use a valid API Key.
  • Request headers must include X-API-KEY, X-TIMESTAMP, and X-SIGN.
  • GET requests have no body; the signing payload is X-TIMESTAMP concatenated with an empty string.

Request parameters

No path parameters, query parameters, or request body.

Request headers

HeaderRequiredDescription
X-API-KEYYesYour API Key
X-TIMESTAMPYesCurrent 13-digit millisecond timestamp; must be within 5 minutes of server time
X-SIGNYesHMAC-SHA256 signature of X-TIMESTAMP + empty body using the app Secret

See 「Authentication / Full call flow」 for complete signing rules.

Response fields

Fields inside the data object only:

FieldTypeSerializedDescription
balancelongstringTotal available credits
buyBalancelongstringAvailable credits from purchases
giveBalancelongstringAvailable credits from grants
recentExpireTimedatenumber / nullExpiry time of the nearest credit batch (ms timestamp); null when no credits available
recentBalancelongstringCredits in the nearest batch that will expire; "0" when no credits available

Field relationships

  • balance = buyBalance + giveBalance.
  • recentExpireTime and recentBalance indicate when and how many credits in the nearest batch expire.
  • When no credits are available, balance, buyBalance, giveBalance, and recentBalance are all "0", and recentExpireTime is null.

cURL example (Linux/macOS)

bash
curl --location --request GET 'https://api.valuescan.ai/api/open/v1/credit/balance' \
--header 'X-API-KEY: your-api-key' \
--header 'X-TIMESTAMP: 1785110400000' \
--header 'X-SIGN: xxxxx' \
--header 'Accept: application/json'

cURL example (Windows CMD)

cmd
curl --location --request GET "https://api.valuescan.ai/api/open/v1/credit/balance" ^
--header "X-API-KEY: your-api-key" ^
--header "X-TIMESTAMP: 1785110400000" ^
--header "X-SIGN: xxxxx" ^
--header "Accept: application/json"

Success response example

json
{
    "code": 200,
    "message": "success",
    "data": {
        "balance": "15000",
        "recentExpireTime": 1785513600000,
        "recentBalance": "3000",
        "buyBalance": "10000",
        "giveBalance": "5000"
    },
    "requestId": "xxx-xxx-xxx"
}

Empty balance response example

json
{
    "code": 200,
    "message": "success",
    "data": {
        "balance": "0",
        "recentExpireTime": null,
        "recentBalance": "0",
        "buyBalance": "0",
        "giveBalance": "0"
    },
    "requestId": "xxx-xxx-xxx"
}

Common errors

CodeDescription
20001Missing API Key
20012Request timestamp expired
20021Signature verification failed
60001Rate limit exceeded
70002OpenAPI access for the current user has been disabled