Skip to main content
POST
/
api
/
governance
/
routing-rules
Error
A valid request URL is required to generate request examples
{
  "message": "<string>",
  "rule": {
    "id": "<string>",
    "name": "<string>",
    "description": "<string>",
    "enabled": true,
    "cel_expression": "<string>",
    "targets": [
      {
        "weight": 0.5,
        "provider": "<string>",
        "model": "<string>",
        "key_id": "<string>"
      }
    ],
    "fallbacks": [
      "<string>"
    ],
    "scope_id": "<string>",
    "priority": 123,
    "query": {},
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.getbifrost.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your provider API key or Bifrost authentication token. Virtual keys (prefixed with sk-bf-) can also be passed here.

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

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