Skip to content

Usage & quota

Each API key has a lifetime cap on minutes of generated audio. Once the cap is reached the server returns 429 and the SDK throws QuotaExceededError.

Check remaining quota

const usage = await client.getUsage();
console.log(
`${usage.minutesUsed.toFixed(1)} / ${usage.minutesLimit ?? ''} min used`
);
if (usage.minutesRemaining !== null && usage.minutesRemaining < 5) {
console.warn('Less than 5 minutes left on this API key.');
}

What getUsage() returns

FieldTypeMeaning
minutesLimitnumber | nullTotal minute quota. null means unlimited.
minutesUsednumberCumulative minutes of generated audio consumed by this key.
minutesRemainingnumber | nullMinutes left before the key is locked. null when there is no limit.
requestsPerDaynumber | nullOptional daily request cap. null means no daily cap.
requestsTodaynumberRequests already made on the current UTC day.

How accounting works

  • The server measures the duration of the generated WAV after each successful clone and adds it to the key’s running total.
  • The quota check happens at request time — already-completed audio is counted; in-flight audio is not. Under heavy parallelism, a small overage past the cap is possible by the size of the in-flight workload.
  • Resetting usage (for a new billing period) is a superadmin action; ask the platform owner.

Handling the error

QuotaExceededError is thrown for both the daily-request cap and the lifetime minute cap — the .message carries the server’s reason string, e.g. Voice-minute quota exhausted (1000.2/1000 min used). Match on the message if you need to discriminate.