Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

Management API authentication for /api/* endpoints. Use the Authorization header with Bearer <API key>. Virtual keys, dashboard/user/session tokens, and x-api-key headers are not supported on management APIs.

Body

application/json

Request to create a routing rule

scope
enum<string>
required

Scope level for the rule

Available options:
global
name
string
required

Name of the routing rule

cel_expression
string
required

CEL expression for matching

targets
object[]
required

Weighted routing targets; weights must sum to 1; target is selected probabilistically at request time

Minimum array length: 1
priority
integer
required

Priority for rule evaluation (lower number = higher priority)

description
string

Optional description

enabled
boolean

Whether the rule is enabled

fallbacks
string[]

Fallback providers in format "provider/model"

scope_id
string | null

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

query
object | null

Visual rule tree structure

Response

Routing rule created successfully

Response containing created/updated routing rule

message
string
rule
object

CEL-based routing rule for intelligent request routing