Create a Model Route
Creates a model route. A 1:1 enablement (model_alias == upstream_model)
for an existing provider/model pair will fold into the existing row
rather than failing — this lets you re-issue the same create call
idempotently from automation.
model_alias — the gateway tries
them in priority order (lowest first) and fails over to the next on
upstream errors.
Two kinds of routes
- 1:1 enablement (
model_alias == upstream_model) — exposes the upstream model under its own name, addressable as<provider>/<upstream_model>. Defaults tobare_alias: false. Re-issuing this call for an existing enablement folds into the existing row, making it idempotent. - Custom alias (
model_alias != upstream_model) — exposes the model under a friendly alias (e.g.team-coding-model). Defaults tobare_alias: trueso callers can use the plain name inmodel. Requires an existing 1:1 enablement on the same(provider, upstream_model)pair.
Example: an alias with failover
The simplest production setup is one alias backed by a primary route plus one or more failover routes:Authorizations
JWT obtained through Barndoor's authentication flow. Pass the token
verbatim in Authorization: Bearer <token>. Use the Barndoor SDK's
loginInteractive() helper to obtain a token in scripts and notebooks.
Body
0 <= x <= 100 <= x <= 180Whether the route participates in bare-alias resolution. Defaults
to true for custom aliases (where model_alias != upstream_model)
and false for 1:1 enablement rows.
1 <= x <= 18001 <= x <= 100001 <= x <= 3600Response
The newly created or updated route
A Model Route maps a client-facing alias to a specific provider and
upstream model. One alias may have multiple routes; the gateway tries
them in priority order and fails over on upstream errors.
"gpt-4o-mini"
"gpt-4o-mini-2024-07-18"
Lower numbers are tried first within the same alias
Same-route retries on upstream 429 before failing over
0 <= x <= 10Cap on honoring upstream Retry-After (0 = use small built-in default)
0 <= x <= 180When true the route participates in plain-alias resolution
(e.g. model: "gpt-4o-mini"). When false it is only
addressable as <provider>/<upstream-model>.
Present on cross-provider listings
1 <= x <= 1800Cap on in-flight requests per gateway pod against this route
1 <= x <= 100001 <= x <= 3600Present (and only present) when one of this route's targeted budgets
with action_on_exhaust = block is currently exhausted. The
runtime drops this route until the budget rolls over.
