v1

latestOpenAPI 3.1.0Apache 2.02026-07-264001921002.3 KB
Governance

Create routing rule

Creates a new CEL-based routing rule for intelligent request routing. Provider and model can be left empty to use the incoming request values.

post/api/governance/routing-rules

Request body

namestring required

Name of the routing rule

descriptionstring

Optional description

enabledboolean

Whether the rule is enabled

cel_expressionstring required

CEL expression for matching

fallbacksstring[]

Fallback providers in format "provider/model"

scope'global' required

Scope level for the rule

scope_idstring nullable

ID for the scope (required if scope is not global)

priorityinteger required

Priority for rule evaluation (lower number = higher priority)

queryobject nullable

Visual rule tree structure

Example request

{
  "targets": [
    {
      "weight": 0.5
    }
  ]
}

Response

Routing rule created successfully

messagestring

Example response

{
  "rule": {
    "targets": [
      {
        "weight": 0.5
      }
    ]
  }
}