references/ai-gateway/features.md
AI Gateway Features
Fetch the relevant guide before setting feature flags, headers, limits, or billing behavior.
| Task | Current documentation | |------|-----------------------| | Enable caching, set TTLs, bypass the cache, or choose a custom cache key | Caching | | Control request volume with fixed or sliding limits | Rate limiting | | Enforce cost budgets | Spend limits | | Evaluate and enforce content policies | Guardrails setup and usage considerations | | Detect sensitive data in prompts and responses | DLP setup | | Choose provider keys or Cloudflare billing | BYOK and Unified Billing | | Configure provider data retention for Unified Billing | Zero Data Retention | | Configure log collection, payload storage, and retention | Logging | | Export logs | Workers Logpush | | Attach request metadata for tracking and routing | Custom metadata | | Override model costs | Custom costs | | Check supported providers, quotas, or pricing | Provider guides, limits, and pricing |
Choose cache keys only for requests whose responses may safely be shared. Decide what prompt and response data may be stored before enabling logging; do not infer a provider's retention policy from gateway log settings.
For conditional policies and fallbacks, see dynamic routing.