Skip to main content
POST
Create a provider
A Provider is a named upstream that authenticates with one credential and serves a model family. Pass connection_id referencing an existing Credential; the provider takes its auth_type and settings from it.
Providers can’t store their own key. Sending api_key or credentials here is rejected with 400, and so is a provider with no connection_id unless its auth type stores no secret (claude_oauth or codex_oauth). To rotate a key, update the credential.

Auto-enabling models in one call

Pass a list of upstream model names in models and Barndoor will create a 1:1 Model Route for each one in the same call. The route’s alias matches the upstream model name so callers can address it as <provider>/<model>. Add bare-name aliases or failover routes afterwards via the Model Routes endpoints.

Example

See the Quickstart Guide for the full walkthrough.

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
base_url
string
required
model_provider
string
required

Provider family, which decides the protocol the gateway speaks upstream, for example openai, anthropic, azure_openai, bedrock, vertex, or custom.

name
string
required
api_key
string | null

Not accepted for auth types that need a stored secret: create a credential and pass connection_id instead.

auth_type
string | null

How the gateway authenticates upstream. Defaults by provider family.

billing_mode
null | enum<string>

Whether the gateway records a per-token cost. Defaults to per_token.

Available options:
per_token,
not_metered
billing_note
string | null

Optional note about the billing arrangement, up to 200 characters.

billing_reason
null | enum<string>

How the vendor bills. Required when billing_mode is not_metered.

Available options:
subscription,
local,
external,
other
catalog_id
string<uuid> | null

Optional provider catalog entry this provider was created from.

change_note
string | null

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

connection_id
string<uuid> | null

ID of the credential this provider uses. Required for every auth type that needs a stored secret.

credentials
any

Not accepted for auth types that need a stored secret: create a credential and pass connection_id instead.

enforce_health_check
boolean | null

Whether routing waits on the connectivity check. Defaults to true; set false to serve the provider even while its check fails.

model_sync_mode
null | enum<string>

Whether the provider follows Barndoor's model catalog. Defaults to off.

Available options:
off,
additive,
full
models
string[]

Upstream model names to enable as 1:1 model routes in the same call.

request_timeout_secs
integer<int32> | null

Provider-wide fallback for the non-streaming request timeout, in seconds (1–600). Rarely needed: routes carry their own timeout.

settings
any

Provider-specific settings as a JSON object, such as region for Bedrock or api_version for Azure OpenAI.

stream_idle_timeout_secs
integer<int32> | null

Provider-wide fallback for the streaming idle timeout, in seconds (1–300). Rarely needed: routes carry their own timeout.

Response

Created

An upstream provider.

auth_type
string
required
base_url
string
required
billing_mode
enum<string>
required

Whether the gateway records a per-token cost for this provider's traffic.

Available options:
per_token,
not_metered
created_at
string<date-time>
required
enabled
boolean
required

Whether the provider may serve traffic.

enforce_health_check
boolean
required

Whether routing waits on the connectivity check. When false the provider serves even while its check fails; health is still recorded.

health_status
string
required

Upstream reachability from the connectivity check: unverified, healthy, or unhealthy. Separate from enabled. An enabled provider that turns unhealthy stops receiving traffic until a check records it healthy again, unless enforce_health_check is false. Some provider families are not checked and stay unverified.

id
string<uuid>
required
model_provider
string
required
model_sync_mode
enum<string>
required

Whether this provider follows Barndoor's model catalog.

Available options:
off,
additive,
full
name
string
required
org_id
string<uuid>
required
secret_path
string
required

Internal reference to the stored secret. This is not the secret.

settings
any
required
updated_at
string<date-time>
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
billing_note
string | null

Note about the billing arrangement.

billing_reason
null | enum<string>

How the vendor bills this provider. Descriptive only.

Available options:
subscription,
local,
external,
other
catalog_id
string<uuid> | null
catalog_slug
string | null
connection_id
string<uuid> | null

ID of the credential this provider uses.

health_checked_at
string<date-time> | null

When the last connectivity check ran; null before the first check.

health_detail
string | null

Reason for the last unhealthy result; null otherwise.

request_timeout_secs
integer<int32> | null

Provider-wide fallback for the non-streaming request timeout, in seconds.

stream_idle_timeout_secs
integer<int32> | null

Provider-wide fallback for the streaming idle timeout, in seconds.