Skip to main content
PUT
Error
Required Permissions How permissions work

Authorizations

Authorization
string
header
required

Management API authentication for /api/* endpoints. Use the Authorization header with Bearer <token>, where <token> is one of:

  • a Bifrost management API key,
  • a dashboard session token issued by POST /api/session/login,
  • base64 of <admin-username>:<admin-password> (legacy equivalent of BasicAuth).

Virtual keys (sk-bf-*) and the x-api-key header are not accepted on management APIs - the sole exception is GET /api/governance/virtual-keys/quota, which is virtual-key-only.

Authentication alone is not sufficient in Bifrost Enterprise: each operation page shows a Required Permissions table (Resource:Operation, for example Dashboard:View) above its Authorizations section, and the caller's RBAC role or management API key scopes must include what it lists, otherwise the request is rejected with 403 Forbidden.

A local admin — authenticated with the admin password, or any caller on a deployment with dashboard auth disabled — bypasses these checks and can call every management endpoint.

OSS setup lock. On Bifrost OSS, while dashboard auth is not active (no admin account, or auth disabled), every management endpoint except the public ones (/health, /api/version, /api/session/is-auth-enabled, /api/session/login, ...) requires the operator's setup token in the X-Bifrost-Setup-Token header, in place of Authorization. The token is set with setup_token in config.json or the BIFROST_SETUP_TOKEN environment variable. A missing header returns 401, a wrong token 403. The header stops working once dashboard auth is enabled. The dashboard instead trades the token once for an HttpOnly bifrost_setup_session cookie via POST /api/session/setup. See Required permissions for how permissions are derived and which endpoints are exempt.

Path Parameters

router_id
string
required

Model router id.

Body

application/json

The targets that replace a model router's. Weights within a tier sum to 1; an empty list clears them.

targets
object[]
required

One model for one tier of a model router. Omitting provider or model keeps the request's value, but a target sets at least one.

Response

Model router targets saved successfully

A model router - an id, a name and a description beside the same settings as ComplexityAnalyzerConfig, sent and returned at the top level; its phrase suggestions, which only model routers make; the model each tier gets; and the routing that decides which requests it takes. Routers are separate from the complexity analyzer config, which routing rules read complexity_tier from. The cross-field rules of ComplexityAnalyzerConfig apply, and the suggestion rules below.

name
string
required

Display name, unique across routers.

Required string length: 1 - 255
keywords
object
required

Reference phrases for semantic complexity classification, one list per tier. Each request is embedded and takes the tier of its nearest phrase. Entries should be whole example prompts rather than individual keywords. Each phrase is limited to 2000 characters, the normalized lists may contain at most 750 phrases combined, and the same phrase cannot appear in two tiers. The field names predate semantic classification and are kept for backward compatibility.

id
string

Stable router id; generated when omitted on create. defaults is reserved, since it names the endpoint that serves a new router's defaults.

Maximum string length: 64
Pattern: ^[A-Za-z0-9_-]+$
description
string
tier_boundaries
object
deprecated

Deprecated score thresholds for the retired lexical complexity classifier. This block is optional and ignored by semantic classification, but remains accepted for backward compatibility. When supplied, values must satisfy 0 < simple_medium < medium_complex < 1.

classifier
enum<string>
default:semantic

Primary complexity classifier. llm classifies with the model in the llm block.

Available options:
semantic,
decision,
llm
semantic
object
conditionally required

Embedding configuration for semantic complexity classification. When absent, no complexity tier is published and rules referencing complexity_tier fall through. The provider must have an enabled key.

decision
object

Decision-model complexity-classifier request settings. Credentials come from the selected provider's configuration.

llm
object
required if classifier = llm
conditionally required

Chat-completion (LLM) classifier settings. Used as the primary classifier when classifier is llm, and as the fallback when semantic.fallback selects llm, where it runs only after semantic classification produces no tier. Otherwise the block is kept but not used. Tier names (SIMPLE, MEDIUM, COMPLEX) and the response format are fixed: the gateway always appends a non-editable reinforcement stating them.

session
object

Session-aware complexity routing. When enabled and a supported session identity is present, Bifrost retains the highest tier observed across normally sequential turns for 24 hours of inactivity. It uses the configured primary classifier and is independent of provider session stickiness.

suggestions
object

Phrase suggestions for the semantic router. When enabled, a sample of the vectors the semantic classifier already computes is kept under each request's log ID (request text stays in the logs), and a run on the schedule clusters that traffic and asks the suggestion model for phrases. Vectors are captured only into the top-level vector_store, and not when that is Chromem, which keeps them in each gateway's memory; with no vector_store, or only the semantic classifier's embedded store, nothing is captured and no run has traffic to read. Captured vectors are deleted with their logs, and become due for deletion after lookback_days or the log retention, whichever is shorter; an hourly cleanup removes them, so one can remain up to an hour past that, and longer while the vector store is unavailable.

targets
object[]
read-only

The model each tier gets. Returned with the router; set with PUT /api/routing/model-routers/{router_id}/targets. Ignored in a create or update body.

One model for one tier of a model router. Omitting provider or model keeps the request's value, but a target sets at least one.

routing
object

Which requests the router takes. Always returned. Optional on create, where omitting it starts the router off, global, with the priority after the last global router. Ignored in an update body; set it with PUT /api/routing/model-routers/{router_id}/routing.