Skip to content

Cost exceeds limit

FieldValue
Type URIhttps://echo.labstack.com/pro/problems/cost-exceeds-limit
Codecost_exceeds_limit
HTTP status403
HTTP statusEnglish title
403Request cost exceeds the plan’s limit

The request’s cost can never fit within one of the plan’s limits, because it is larger than that limit’s capacity. Quota checks this before the credit balance. Quota returns this 403; it does not mean the caller lacks permission.

Retrying the same request does not succeed. Reduce the request’s cost, for example by splitting the work, or use a plan with a larger limit. violated-policies names the limit.

If your application installs a custom handler, the body may differ.

HTTP/1.1 403 Forbidden
Content-Type: application/problem+json
{
"code": "cost_exceeds_limit",
"status": 403,
"title": "Request cost exceeds the plan's limit",
"type": "https://echo.labstack.com/pro/problems/cost-exceeds-limit",
"violated-policies": [
"requests"
]
}

Check MiddlewareConfig.Cost and the selected plan. Waiting cannot help a request whose cost exceeds the limit’s full capacity.

  • code (string, always): The stable code above.
  • type (string, always): The exact type URI above.
  • title (string, always): English title. Quota administration routes use their own titles for some codes.
  • status (integer, always): The HTTP status of the response.
  • detail (string, optional): Human-readable explanation, omitted when empty. Its wording is not a stable format.
  • violated-policies (array, always): IDs of the limits involved: [] when there are none, never null.

Headers:

  • RateLimit-Policy, RateLimit (conditional): Draft-11 rate-limit fields. The middleware sends them when Headers is Draft11 (the default) or Draft11AndLegacy. It skips them when the plan has no limit to report. UsageHandler never sends them.
  • X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (conditional): Legacy rate-limit fields, sent by the middleware when Headers is Legacy or Draft11AndLegacy.

See quota for plans, credit adjustments and usage.