Skip to main content
VertaaUX Docs
APIEndpoints

Check Quota

View your usage and remaining credits

Check Quota

GET/v1/quota

Check your current usage and remaining credits for the billing period. Use this endpoint to monitor your quota before creating audits.

Response

planstringenum: free | pro | agency | enterprise

Your current subscription tier.

credits_totalnumber

Total credits available in your plan for the current period.

credits_usednumber

Credits consumed so far in the current period.

credits_remainingnumber

Credits remaining (credits_total - credits_used).

reset_datestring

ISO 8601 timestamp when your quota resets (midnight UTC).

Example Response

{
  "plan": "pro",
  "credits_total": 1000,
  "credits_used": 47,
  "credits_remaining": 953,
  "reset_date": "2024-01-16T00:00:00.000Z"
}

Tier Limits

TierDaily LimitReset Time
Free3Midnight UTC
Pro1,000Midnight UTC
Agency5,000Midnight UTC
EnterpriseUnlimited-

Enterprise customers have no hard limits. Contact support if you need higher throughput.

HTTP Status Codes

StatusDescription
200 OKQuota information retrieved successfully.
401 UnauthorizedMissing or invalid API key.

Code Examples

import 'dotenv/config';

interface QuotaResponse {
  plan: 'free' | 'pro' | 'agency' | 'enterprise';
  credits_total: number;
  credits_used: number;
  credits_remaining: number;
  reset_date: string;
}

async function getQuota(): Promise<QuotaResponse> {
  const response = await fetch('https://vertaaux.ai/api/v1/quota', {
    headers: {
      'X-API-Key': process.env.VERTAAUX_API_KEY!,
    },
  });

  if (!response.ok) {
    const error = await response.json();
    throw new Error(`Failed to get quota: ${error.message}`);
  }

  return response.json();
}

// Usage
const quota = await getQuota();
console.log(`Plan: ${quota.plan}`);
console.log(`Remaining: ${quota.credits_remaining}/${quota.credits_total}`);
// Output:
// Plan: pro
// Remaining: 953/1000
curl https://vertaaux.ai/api/v1/quota \
  -H "X-API-Key: $VERTAAUX_API_KEY"

Response:

{
  "plan": "pro",
  "credits_total": 1000,
  "credits_used": 47,
  "credits_remaining": 953,
  "reset_date": "2024-01-16T00:00:00.000Z"
}
import os
import requests
from typing import TypedDict, Literal

class QuotaResponse(TypedDict):
    plan: Literal['free', 'pro', 'agency', 'enterprise']
    credits_total: int
    credits_used: int
    credits_remaining: int
    reset_date: str

def get_quota() -> QuotaResponse:
    """Get current quota usage."""
    response = requests.get(
        'https://vertaaux.ai/api/v1/quota',
        headers={'X-API-Key': os.environ['VERTAAUX_API_KEY']}
    )

    if not response.ok:
        error = response.json()
        raise Exception(f"Failed to get quota: {error.get('message')}")

    return response.json()

# Usage
quota = get_quota()
print(f"Plan: {quota['plan']}")
print(f"Remaining: {quota['credits_remaining']}/{quota['credits_total']}")
# Output:
# Plan: pro
# Remaining: 953/1000

Check Before Creating Audit

Best practice is to verify quota before creating an audit:

async function createAuditSafely(url: string) {
  // Check quota first
  const quota = await getQuota();

  if (quota.credits_remaining === 0) {
    const resetTime = new Date(quota.reset_date).toLocaleString();
    throw new Error(`Quota exhausted. Resets at ${resetTime}`);
  }

  // Proceed with audit
  return createAudit(url);
}

Rate Limit Headers

The quota endpoint also returns rate limit headers:

HeaderDescription
X-RateLimit-LimitYour daily quota limit
X-RateLimit-RemainingRemaining credits
X-RateLimit-ResetUnix timestamp when quota resets
curl -i https://vertaaux.ai/api/v1/quota \
  -H "X-API-Key: $VERTAAUX_API_KEY"

# Response headers:
# X-RateLimit-Limit: 1000
# X-RateLimit-Remaining: 953
# X-RateLimit-Reset: 1705363200

Caching

Quota responses are cached for 60 seconds to reduce database load. For real-time accuracy, use the rate limit headers from the Create Audit response.

Also Available

InterfaceCommand/Method
CLIvertaa quota
SDKclient.getQuota()

Was this page helpful?

On this page