Rate Limits

Understanding API usage limits and quota management.

Overview

The Kantesti API uses a credit-based quota system. Each successful production request consumes 1 credit from your account quota.

Quota System
Production requests1 credit per successful request
Sandbox requestsFree (no quota consumed)
Failed requestsNo quota consumed

Sandbox Mode

Sandbox endpoints are free and do not consume quota. Use them for:

  • Development - Build and test your integration
  • Testing - Validate request/response handling
  • Demos - Show API capabilities without cost
Sandbox Endpoints

Replace /analyze with /sandbox in any production endpoint:

  • /api/v11/01-06-2025/sandbox
  • /api/v11/health-score/sandbox
  • /api/v1/nutrition/sandbox
  • /api/v1/bloodtest/comparison/sandbox

Checking Your Quota

Use the quota check endpoint to monitor your remaining credits:

curl -X POST "https://app.aibloodtestinterpret.com/api/quota/check" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "YOUR_USERNAME",
    "password": "YOUR_PASSWORD"
  }'

Response

{
  "status": "success",
  "data": {
    "username": "your_username",
    "remaining_quota": 150,
    "timestamp": "2025-12-22T10:30:00Z"
  }
}

When Quota is Exceeded

When your quota is exhausted, the API returns a QUOTA_1101 error:

{
  "status": "error",
  "error": {
    "code": "QUOTA_1101",
    "message": "Insufficient API quota",
    "details": "Current quota: 0. Visit our website to purchase more credits.",
    "timestamp": "2025-12-22T10:30:00Z"
  }
}
What to do when quota is exceeded
  1. Purchase additional credits from kantesti.net
  2. Use sandbox endpoints for testing while waiting
  3. Contact support for enterprise plans with higher limits

Best Practices

Optimize Quota Usage

  • Use sandbox for development - Switch to production only when ready
  • Batch test uploads - Combine multiple pages into single PDF
  • Cache results - Store analysis results to avoid re-processing
  • Monitor usage - Regularly check remaining quota

Handle Quota Errors

async function analyzeWithQuotaCheck(file) {
  // Check quota before making request
  const quotaResponse = await checkQuota();

  if (quotaResponse.data.remaining_quota < 1) {
    throw new Error('No quota remaining. Please purchase more credits.');
  }

  // Proceed with analysis
  return await analyzeBloodTest(file);
}

async function checkQuota() {
  const response = await fetch('/api/quota/check', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ username, password })
  });
  return response.json();
}

Enterprise Plans

For high-volume usage, contact us for enterprise plans with:

  • Higher quota limits
  • Volume discounts
  • Priority support
  • Custom SLAs
  • Dedicated infrastructure

Contact: [email protected]