{"id":532,"date":"2026-06-05T00:00:00","date_gmt":"2026-06-05T00:00:00","guid":{"rendered":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/06\/05\/ai-gateway-control-ai-costs-with-spend-limits-2\/"},"modified":"2026-06-05T00:00:00","modified_gmt":"2026-06-05T00:00:00","slug":"ai-gateway-control-ai-costs-with-spend-limits-2","status":"publish","type":"post","link":"https:\/\/wordpress.securinsight.ca\/index.php\/2026\/06\/05\/ai-gateway-control-ai-costs-with-spend-limits-2\/","title":{"rendered":"AI Gateway &#8211; Control AI costs with spend limits"},"content":{"rendered":"<p>AI Gateway now supports spend limits \u2014 cost-based budgets that track cumulative dollar spend and block requests when the budget is exceeded. Unlike rate limiting, which caps the number of requests, spend limits track actual cost based on token usage and model pricing.<\/p>\n<p>You can scope limits by model, provider, or custom metadata dimensions. For example, give each user a $200\/day budget, cap total gateway spend at $10,000\/day, or limit a specific model to $50\/day per user. Each rule uses a configurable time window with fixed or sliding enforcement.<\/p>\n<p>Spend limits work with both <a href=\"https:\/\/developers.cloudflare.com\/ai-gateway\/features\/unified-billing\/\">Unified Billing<\/a> and <a href=\"https:\/\/developers.cloudflare.com\/ai-gateway\/configuration\/bring-your-own-keys\/\">BYOK<\/a> requests for models with known pricing.<\/p>\n<p>For more details, refer to the <a href=\"https:\/\/developers.cloudflare.com\/ai-gateway\/features\/spend-limits\/\">Spend limits documentation<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>AI Gateway now supports spend limits \u2014 cost-based budgets that track cumulative dollar spend and block requests when the budget is exceeded. Unlike rate limiting, which caps the number of requests, spend limits track actual cost based on token usage and model pricing. You can scope limits by model, provider, or custom metadata dimensions. For [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-532","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/comments?post=532"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/posts\/532\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/media?parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/categories?post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.securinsight.ca\/index.php\/wp-json\/wp\/v2\/tags?post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}