Skip to main content
POST
Create a model route
A Model Route maps a client-facing alias to a (provider, upstream model) pair. Multiple routes can share the same 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 to bare_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 to bare_alias: true so callers can use the plain name in model. Requires an existing 1:1 enablement on the same (provider, upstream_model) pair.
Every route also carries its own retry policy (retry_on_429_*), timeouts, and passive-health cooldown settings (cooldown_*); omitted fields take the platform defaults. Change them later with Update a model route.

Example: an alias with failover

The simplest production setup is one alias backed by a primary route plus one or more failover routes: Route 1 is a 1:1 enablement opted into bare-name resolution, so callers can send claude-opus-5-5 without a provider prefix. Route 2 is a custom alias with the same name on Bedrock, so the 1:1 enablement of anthropic.claude-opus-5-5 on that provider must exist first.
For more on failover, retry policies, and bare aliases see Define Model Routes.

Authorizations

Authorization
string
header
required

An access token from Barndoor's identity provider, sent as Authorization: Bearer <token>. Use a service-account token from the OAuth 2.0 client-credentials grant for scripts and CI, or a signed-in user's token. The caller needs the admin role in the organization. Gateway API keys (bd-...) are not accepted here.

Body

application/json
model_alias
string
required

Caller-facing model name: what API callers send in model.

provider_id
string<uuid>
required
upstream_model
string
required

The provider's name for the model.

bare_alias
boolean | null

Whether the route answers requests that name the alias alone, without a <provider>/ prefix. Defaults to true for custom aliases and false for 1:1 enablements.

change_note
string | null

Optional note explaining why this was created. Shown with the record and in the audit log.

cooldown_429_default_secs
integer<int32> | null

Cooldown after an upstream 429 with no usable Retry-After, in seconds (1–3600, and at most cooldown_max_secs). Defaults to 30.

cooldown_base_secs
integer<int32> | null

First cooldown window, in seconds, doubled after each failed recovery probe up to cooldown_max_secs (1–3600, and at most cooldown_max_secs). Defaults to 30.

cooldown_failure_threshold
integer<int32> | null

Gateway failures (5xx responses, timeouts, connection errors, and 401/403 from a stored key) within cooldown_window_secs that put the route in cooldown (0–100). 0 disables cooldowns for the route. Defaults to 10.

cooldown_max_secs
integer<int32> | null

Longest cooldown window, in seconds (1–86400). Defaults to 300.

cooldown_overloaded_secs
integer<int32> | null

Cooldown after an upstream 529 (overloaded) with no usable Retry-After, in seconds (0–3600, and at most cooldown_max_secs unless 0). 0 treats a 529 as an ordinary failure. Defaults to 10.

cooldown_window_secs
integer<int32> | null

Length of the rolling failure window, in seconds (1–3600). Defaults to 60.

enabled
boolean

Whether the route serves traffic. Defaults to true.

priority
integer<int32>

Failover order among routes serving the same alias; lower is tried first. Defaults to 0.

request_timeout_secs
integer<int32> | null

Total-request timeout for non-streaming requests, in seconds (1–600). Defaults to 120 when unset. On a 1:1 enablement row this sets the timeout for every alias of the model.

retry_on_429_count
integer<int32>

Retries on the same route after an upstream 429 before failing over (0–10). 0 fails over immediately.

retry_on_429_max_wait_secs
integer<int32>

Longest upstream Retry-After to honor, in seconds (0–180). 0 uses a short built-in wait and ignores the header.

source
null | enum<string>

Whether the model was chosen from the catalog (catalog) or typed in (custom). Defaults to the 1:1 enablement's value when one exists, otherwise catalog.

Available options:
catalog,
custom
stream_idle_timeout_secs
integer<int32> | null

Idle timeout between chunks of a streaming response, in seconds (1–300). Defaults to 180 when unset.

Response

Created

A model route.

cooldown_429_default_secs
integer<int32>
required

Cooldown after an upstream 429 with no usable Retry-After, in seconds.

cooldown_base_secs
integer<int32>
required

First cooldown window, in seconds. Doubles after each failed recovery probe, up to cooldown_max_secs.

cooldown_failure_threshold
integer<int32>
required

Gateway failures within cooldown_window_secs that put the route in cooldown. 0 disables cooldowns for the route.

cooldown_max_secs
integer<int32>
required

Longest cooldown window, in seconds.

cooldown_overloaded_secs
integer<int32>
required

Cooldown after an upstream 529 (overloaded) with no usable Retry-After, in seconds. 0 treats a 529 as an ordinary failure.

cooldown_window_secs
integer<int32>
required

Length of the rolling failure window, in seconds.

bare_alias
boolean
required

Whether the route answers requests that name the alias alone. When false, the model is reachable only as <provider>/<upstream_model>. Custom aliases are always true.

enabled
boolean
required
id
string<uuid>
required
model_alias
string
required
priority
integer<int32>
required

Failover order among routes serving the same alias; lower is tried first.

provider_id
string<uuid>
required
retry_on_429_count
integer<int32>
required

Same-route retries on upstream 429. 0 means immediate failover.

retry_on_429_max_wait_secs
integer<int32>
required

Longest upstream Retry-After to honor, in seconds. 0 uses a short built-in wait and ignores the header.

source
enum<string>
required

Whether the model was chosen from the catalog or typed in when the route was created.

Available options:
catalog,
custom
upstream_model
string
required
created_by_email
string | null
created_by_name
string | null
created_by_user_id
string<uuid> | null
last_change_note
string | null

Note explaining the last change.

last_modified_at
string<date-time> | null

When the last attributed change was made.

last_modified_by_email
string | null
last_modified_by_name
string | null
last_modified_by_user_id
string<uuid> | null
auto_disabled_reason
null | enum<string>

Set when the gateway disabled this route because the model left the provider's catalog. Any admin change to enabled clears it.

Available options:
catalog_retired
request_timeout_secs
integer<int32> | null

Total-request timeout for non-streaming requests, in seconds (1–600).

stream_idle_timeout_secs
integer<int32> | null

Idle timeout between chunks of a streaming response, in seconds (1–300).