Skip to main content
GET
/
v1
/
credits
/
balance
Balance
curl --request GET \
  --url https://api.example.com/v1/credits/balance
Returns the current credit balance for the authenticated API key.

Authentication

Requires a valid API key via Authorization: Bearer YOUR_API_KEY.
  • User API keys return the user’s credit balance.
  • Organization API keys return the organization’s provider balance (revenue).

Response

{
  "balance": "$5.00"
}

Response Fields

FieldTypeDescription
balancestringFormatted dollar balance

Example

curl 'https://api.orth.sh/v1/credits/balance' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Check Sufficiency

Use POST /v1/credits/check to verify you have enough balance before making an API call:
curl -X POST 'https://api.orth.sh/v1/credits/check' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"amountCents": 100}'
{
  "sufficient": true,
  "balanceCents": 500000,
  "requiredCents": 100,
  "shortfallCents": 0
}