Obter o saldo de créditos
RegistosGET /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.
Parâmetros
account_idAccount whose credit balance is returned; when omitted, the first account in the caller's scope is used.
Devolve
200 Account credit balance summary
curl -X GET "$CONSUMER_API/credits" \
-H "Authorization: Bearer sk_test_..."
# Sem comando CLI equivalente; use cURL ou HTTP directo.
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