Skip to main content

Billing Credits

/v1/dashboard/billing/credits

Check remaining credits

Returns your current billing balance, including PAYG credits (in USD) and subscription cycle quota. Authenticate with any API key — no admin key required.

Apertis Exclusive

Neither OpenAI nor Anthropic offer a programmatic endpoint for checking remaining credits. This is an Apertis-only feature.

HTTP Request

curl https://api.apertis.ai/v1/dashboard/billing/credits \
-H "Authorization: Bearer <APERTIS_API_KEY>"
  • <APERTIS_API_KEY>: Any valid API key (sk- or sk-sub-)

Response (PAYG Only)

When using a standard API key with no active subscription:

{
"object": "billing_credits",
"is_subscriber": false,
"payg": {
"remaining_usd": 5.0,
"used_usd": 2.0,
"total_usd": 7.0,
"is_unlimited": false
}
}

Response (Subscription)

When the account has an active subscription plan:

{
"object": "billing_credits",
"is_subscriber": true,
"payg": {
"remaining_usd": 0.95,
"used_usd": 0.05,
"total_usd": 1.0,
"is_unlimited": false
},
"subscription": {
"plan_type": "lite",
"status": "active",
"cycle_quota_limit": 600,
"cycle_quota_used": 3,
"cycle_quota_remaining": 597,
"cycle_start": "2026-03-16T10:02:35Z",
"cycle_end": "2026-04-16T10:02:35Z",
"payg_fallback_enabled": false
}
}

Response (Subscription with PAYG Fallback)

When the subscription has PAYG overage enabled:

{
"object": "billing_credits",
"is_subscriber": true,
"payg": {
"remaining_usd": 3.0,
"used_usd": 0.5,
"total_usd": 3.5,
"is_unlimited": false
},
"subscription": {
"plan_type": "max",
"status": "active",
"cycle_quota_limit": 5000,
"cycle_quota_used": 5000,
"cycle_quota_remaining": 0,
"cycle_start": "2026-03-01T00:00:00Z",
"cycle_end": "2026-04-01T00:00:00Z",
"payg_fallback_enabled": true,
"payg_spent_usd": 2.5,
"payg_limit_usd": 10.0
}
}

Response Fields

Top Level

FieldTypeDescription
objectstringAlways "billing_credits"
is_subscriberbooleanWhether the account has an active subscription
paygobjectPAYG credit balance (always present)
subscriptionobjectSubscription quota details (only present when subscribed)

payg Object

FieldTypeDescription
remaining_usdnumber | nullRemaining credits in USD. null when is_unlimited is true
used_usdnumberTotal credits consumed in USD
total_usdnumber | nullTotal credits (remaining + used) in USD. null when unlimited
is_unlimitedbooleanWhether the API key has unlimited quota
monthly_limit_usdnumberMonthly spending limit in USD (only present if configured)
monthly_used_usdnumberSpending in current month in USD (only present if limit configured)
monthly_reset_dayintegerDay of month when the monthly counter resets (only present if limit configured)

subscription Object

FieldTypeDescription
plan_typestringPlan name: lite, pro, or max
statusstringSubscription status: active, suspended, or cancelled
cycle_quota_limitintegerTotal quota allocation for the current billing cycle
cycle_quota_usedintegerQuota consumed in the current cycle
cycle_quota_remainingintegerRemaining quota in the current cycle
cycle_startstringCurrent cycle start date (ISO 8601)
cycle_endstringCurrent cycle end date (ISO 8601)
payg_fallback_enabledbooleanWhether PAYG overage billing is enabled when cycle quota is exhausted
payg_spent_usdnumberPAYG overage spent this cycle in USD (only present when fallback enabled)
payg_limit_usdnumberPAYG overage spending limit in USD (only present when fallback enabled and limit set)

Token-Level vs User-Level

When using an API key, the payg section shows the specific token's quota balance by default. All tokens belonging to the same account will see the same subscription data.

Python Example

import requests

response = requests.get(
"https://api.apertis.ai/v1/dashboard/billing/credits",
headers={"Authorization": "Bearer sk-your-api-key"}
)
credits = response.json()

if credits["is_subscriber"]:
sub = credits["subscription"]
print(f"Plan: {sub['plan_type']}")
print(f"Quota: {sub['cycle_quota_used']}/{sub['cycle_quota_limit']} used")
print(f"Remaining: {sub['cycle_quota_remaining']}")
else:
payg = credits["payg"]
print(f"Balance: ${payg['remaining_usd']:.2f} USD")

Node.js Example

const response = await fetch(
'https://api.apertis.ai/v1/dashboard/billing/credits',
{ headers: { Authorization: 'Bearer sk-your-api-key' } }
);
const credits = await response.json();

if (credits.is_subscriber) {
const { plan_type, cycle_quota_used, cycle_quota_limit } = credits.subscription;
console.log(`${plan_type}: ${cycle_quota_used}/${cycle_quota_limit} quota used`);
} else {
console.log(`Balance: $${credits.payg.remaining_usd.toFixed(2)}`);
}