Skip to main content

Endpoint

GET /api/v1/usage
Host: api.driftguard.dev

Request

curl -s https://api.driftguard.dev/api/v1/usage \
  -H "X-API-Key: $DRIFTGUARD_KEY"

Response

{
  "credits_remaining": 477,
  "credits_used": 23,
  "total_checks": 23
}

Response Fields

FieldTypeDescription
credits_remainingintegerCredits currently available on your account. Each POST /api/v1/check deducts 1 credit.
credits_usedintegerTotal credits consumed so far
total_checksintegerTotal number of schema checks run on your account
Credits never expire. Top up anytime from driftguard.dev.

Rate Limits

The DriftGuard API allows 100 requests per minute per API key across all endpoints. When exceeded, you’ll receive a 429 Too Many Requests response. If your credits_remaining reaches 0, all calls to POST /api/v1/check will return 403 Forbidden until your account is topped up.

Error Responses

StatusMeaning
401Missing or invalid X-API-Key
429Rate limit exceeded — 100 req/min per key

Use this endpoint to build dashboards or alerting around credit consumption. Poll it after each check run to track depletion in real time.

Run a Check

Each check call costs 1 credit — see what triggers deductions.

Authentication

Learn about API key types, rate limits, and key management.