Get consumer account credit balance and active grants
LogsGET /credits
Returns the credit balance of an account linked to the caller, with its credit grants such as promotional credit. Returns 403 when the given account is not one the caller can access and 404 when the caller has no linked account.
Parameters
account_idAccount whose credit balance is returned; when omitted, the first account in the caller's scope is used.
Returns
200 Account credit balance summary
curl -X GET "$CONSUMER_API/credits" \
-H "Authorization: Bearer sk_test_..."
# No matching CLI command; use cURL or direct HTTP.
const res = await fetch("$CONSUMER_API/credits", {
method: "GET",
headers: {
Authorization: "Bearer sk_test_..."
}
});
const data = await res.json();
import requests
res = requests.get(
"$CONSUMER_API/credits",
headers={
"Authorization": "Bearer sk_test_..."
}
)
data = res.json()
req, _ := http.NewRequest("GET", "$CONSUMER_API/credits", nil)
req.Header.Set("Authorization", "Bearer sk_test_...")
resp, err := http.DefaultClient.Do(req)
Account credit balance summary