Developer documentation
Credits, quotas, and limits
Predict request cost and interpret the correct usage headers for your plan.
- Audience
- Developers and partner administrators
- Before you start
- An API key and knowledge of whether your account is prepaid or contracted
How usage is calculated
Each completed generation consumes one credit per generated exercise (answer included). Counts are summed across all entries.
| Problems requested | Credits |
|---|---|
| 5 | 5 |
| 20 | 20 |
| 50 | 50 |
- GET /catalog is free, although it requires a valid key.
- JSON, PDF, LaTeX, and embed creation use the same calculation.
- Embed views are free.
- A request that fails during validation, generation, rendering, or minting consumes no credit or quota.
Headers by plan
| Plan | Success headers | Unit |
|---|---|---|
| Prepaid credits | X-RateLimit-LimitX-RateLimit-Remaining | Credits; limit is the balance before the request and remaining is the post-request balance |
| Contracted monthly quota | X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset | Problems; reset is seconds until the next UTC month |
| Metered, negotiated only | X-Usage-Accrued-CentsX-Usage-Cap-CentsX-Usage-Warning | Accrued cents and an optional cap |
Request limits
- Each entry must request an integer from 1 through 30 problems.
- The sum across all entries cannot exceed 150 problems.
- difficulty must be easy, medium, or hard and be available for the chosen topic.
- An embed accepts at most 20 allowed domains and a title up to 128 characters.
- A per-key burst limiter applies. When triggered, the 429 includes Retry-After; do not assume a fixed global rate across deployments.
When capacity is exhausted
A prepaid account receives 402 insufficient_credits until credits are purchased or granted. An exhausted monthly quota receives 429 quota_exceeded plus Retry-After until the next UTC month. Do not retry these automatically.
