Patch item
PATCH /api/v1/arbitrage/rules/{id}
Read or update saved provider-routing rules for the authenticated account. Rules are stored and validated but are not applied to requests yet; requests continue to follow the account's default routing.
Authenticate with a portal session token.
Parameters
idstring path required
Request body (optional)
application/json OrggrcArbitrageRuleUpdate
conditionobjectSupported keys are lang, role, length, region, and expr. The expr value is parsed as a condition with prompt.tokens, cost.cents_estimate, length, detector.<id>, task, tier, lang, role, region, or needs.reasoning fields; comparisons may be joined by AND or OR and grouped with parentheses. Expressions and model targets are validated when saved. These saved rules are not currently applied to inference requests. An empty condition is allowed only when is_catch_all is true.
exprstringA condition expression; see the supported fields and operators on condition.
Length: at most 2048 characterslanganylengthanyregionanyroleany
enabledbooleanfallback_providerstring or nullA provider slug, provider/model pair, or model ID from the current provider catalog. Display names without a matching catalog ID are rejected.
Length: at most 60 characters. Example:"openai/gpt-5.4-mini"is_catch_allbooleannamestringLength: 1 to 120 characterspositionintegerRange: 0 to 9999primary_providerstringA provider slug, provider/model pair, or model ID from the current provider catalog. Display names without a matching catalog ID are rejected.
Length: at most 60 characters. Example:"anthropic/claude-haiku-4-5"weightintegerRange: 1 to 100
Example
{
"enabled": false
}Responses
200 Operation completed successfully.
application/json object
Any keys are accepted.
401 Authentication is required or invalid.
application/json ErrorWithCode
error_codestring requiredmessagestring requiredrequest_idstring (uuid)statusstring requiredExample:"error"
403 The authenticated user is not permitted to perform this operation.
application/json ErrorWithCode
error_codestring requiredmessagestring requiredrequest_idstring (uuid)statusstring requiredExample:"error"
404 The requested resource was not found.
application/json ErrorWithCode
error_codestring requiredmessagestring requiredrequest_idstring (uuid)statusstring requiredExample:"error"
422 The expression or provider/model target failed validation.
application/json ArbitrageRuleValidationError
errorErrorWithCodemessagestringerrorsobject requiredOther keys: array of string
429 The request was rate limited. API-generated responses are JSON;
Response headers
Retry-Afterstring headerSeconds to wait before retrying, when provided.
X-RateLimit-Scopestring headerIdentifies the scope of the request limit, when provided.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.
text/html string
500 The operation failed because of a server error.
application/json GenericError
erroranyOne of
- string
- object
Any keys are accepted.
error_codestringcodestringmessagestringdetailstringstatusanyOne of
- string
- integer
errorsobjectAny keys are accepted.