API Reference
Log In
API Reference

Update a Cost Control (partial)

Updates only the fields present in the request body. Omit a field to keep its current value. Send null to clear it. This applies to description, denyMessage, warnThreshold, hardLimit and groupBy. Passing filters (including an empty list) replaces the full filter set; omit filters to leave it unchanged. The same replacement rule applies to notificationChannelIds and notificationEmails (for notificationEmails, null also leaves the addresses unchanged).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Revenium-generated identifier of the cost control

Body Params

Cost control configuration for cost enforcement. Shadow mode evaluates without blocking; non-shadow rules block AI transactions when the threshold is crossed within the rolling window.

string | null
required

Display name for this rule

string | null

Optional human-readable description of the rule's purpose. Omit a field to keep its current value. Send null to clear it.

string | null

Optional message you write, shown to the AI agent when this rule blocks or warns on a request. Revenium's budget gate shows this message to the agent and fills in these placeholders: {model}, {spent}, {limit}, {window}, {percentUsed}, {ruleName}. The action directive shown alongside it is added by Revenium, not this field. Omit a field to keep its current value. Send null to clear it.

Metadata of a resource

string | null
required

The Revenium-generated identifier of the team that owns this rule

string | null
enum
required

The AI metric the rule evaluates against

number | null

Optional soft threshold that triggers a warning without blocking. Unit matches hardLimit: dollars for TOTAL_COST, whole counts for token/error metrics. Omit a field to keep its current value. Send null to clear it.

number | null

Hard enforcement threshold in the metric's native unit: dollars for metricType=TOTAL_COST (e.g. 10 = $10/window), or a whole count for metricType=TOKEN_COUNT / ERROR_COUNT / etc. When crossed and the rule is not in shadow mode, the declared action is executed. Omit a field to keep its current value. Send null to clear it.

string | null
enum
required

Rolling window over which usage is accumulated

Allowed:
string | null
enum
required

Enforcement action taken when hardLimit is crossed (and rule is not in shadow mode). Only BLOCK and WARN_ONLY are accepted on create and update.

Allowed:
boolean | null

When true, the rule evaluates without actually blocking. Use it to validate limits before enforcing them.

boolean | null

Whether the rule is active. Disabled rules are kept for history but are not evaluated.

string | null
enum

Optional dimension to partition the rule evaluation (per-model, per-provider, etc.). Omit a field to keep its current value. Send null to clear it.

filters
array of objects | null

Optional filter predicates narrowing which AI metric events the rule applies to. PATCH: passing an empty list clears all filters; passing a non-empty list replaces the set.

filters
notificationChannelIds
array of strings | null

Optional notification channels that receive alerts when the rule fires. Use slack:

notificationChannelIds
notificationEmails
array of strings | null

Optional email addresses that receive the rule's warn and block notices, at most 10. Addresses are trimmed and lowercased, and duplicates collapse. Shadow-mode rules email a preview, as Slack does. PATCH: passing an empty list clears the addresses; passing a non-empty list replaces them; omitting the field or passing JSON null leaves them unchanged.

notificationEmails
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
*/*