Skip to main content
Check your remaining API credit balance at any time without consuming credits.
Cost: Free (0 credits)
Interactive Playground: Test this endpoint in the API Playground. Get your API key at data.octav.fi

Endpoint

GET https://api.octav.fi/v1/credits

No parameters required.

Example

curl "https://api.octav.fi/v1/credits" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

Returns a simple number representing your remaining credits.
19033

Use Cases

  • Monitor Balance
  • Alert on Low Balance
  • Track Usage
  • Budget Management
Check credits before expensive operations:
async function checkCreditsBeforeSync(address) {
  // Check available credits
  const response = await fetch('https://api.octav.fi/v1/credits', {
    headers: { 'Authorization': `Bearer ${apiKey}` }
  });
  const credits = await response.json();

  console.log(`Available credits: ${credits}`);

  // Estimate sync cost (rough estimate)
  const statusResponse = await fetch(
    `https://api.octav.fi/v1/status?addresses=${address}`,
    { headers: { 'Authorization': `Bearer ${apiKey}` } }
  );
  const [status] = await statusResponse.json();

  if (credits < 50) {
    console.warn('Low credits! Consider purchasing more.');
    return false;
  }

  // Proceed with sync
  await fetch('https://api.octav.fi/v1/sync-transactions', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${apiKey}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ addresses: [address] })
  });

  return true;
}

Best Practices

Since this endpoint is free, check it liberally:
  • Before expensive operations
  • In application health checks
  • When displaying usage stats to users
Implement automated alerts:
  • Alert at 20% remaining
  • Warning at 10% remaining
  • Critical at 5% remaining
Monitor consumption patterns:
  • Track daily usage
  • Forecast when credits will run out
  • Purchase credits before running low