Cost exceeds limit
Identifiers
Section titled “Identifiers”| Field | Value |
|---|---|
| Type URI | https://echo.labstack.com/pro/problems/cost-exceeds-limit |
| Code | cost_exceeds_limit |
| HTTP status | 403 |
| HTTP status | English title |
|---|---|
| 403 | Request cost exceeds the plan’s limit |
When it occurs
Section titled “When it occurs”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.
Client handling
Section titled “Client handling”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.
Example response
Section titled “Example response”If your application installs a custom handler, the body may differ.
HTTP/1.1 403 ForbiddenContent-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" ]}Server correction
Section titled “Server correction”Check MiddlewareConfig.Cost and the selected plan. Waiting cannot help a request whose cost exceeds the limit’s full capacity.
Response fields
Section titled “Response fields”Quota middleware
Section titled “Quota middleware”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 whenHeadersisDraft11(the default) orDraft11AndLegacy. It skips them when the plan has no limit to report.UsageHandlernever sends them.X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset(conditional): Legacy rate-limit fields, sent by the middleware whenHeadersisLegacyorDraft11AndLegacy.
Related behavior
Section titled “Related behavior”See quota for plans, credit adjustments and usage.