Caching and Errors

Cache headers

Successful Dev API responses include:

Cache-Control: public, max-age=300, s-maxage=300, stale-while-revalidate=300
Vary: x-api-key

This means cached responses can remain visible for up to about 5 minutes before refresh.

Usage increment behavior

Usage increments after key validation and endpoint-level success flow. Increment is cached first, then synced to Firestore hourly.

Operational notes:

  • Dashboard usage can lag behind real-time usage
  • Quota enforcement uses cached usage and stays accurate

Error reference

StatusMeaningFix
400Invalid query shapePass exactly one of id or slug where required
401Missing or invalid keySend valid x-api-key
403Inactive key or scope mismatchRe-enable key or use matching project key
404Resource not foundVerify id or slug
429Monthly limit exceededWait for reset

Error schema

type ApiError = {
  detail: string
}

Troubleshooting stale content

If API output looks stale, wait for cache expiry (~5 minutes). If your own CDN is in front, purge that layer separately.

Whitepapper

Whitepapper is an API first CMS engine for devs who publish content.

Antk i n