Create a Provider - Barndoor Documentation

Create a provider

cURL

curl --request POST \
  --url https://app.barndoor.ai/api/llm-gateway/admin/providers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "model_provider": "openai",
  "base_url": "<string>",
  "auth_type": "api_key",
  "api_key": "<string>",
  "catalog_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "models": [\
    "gpt-4o-mini",\
    "gpt-4o"\
  ],
  "settings": {},
  "credentials": {},
  "request_timeout_secs": 1800,
  "stream_idle_timeout_secs": 900
}
'

JSON Payload Example

{
  "name": "<string>",
  "model_provider": "openai",
  "base_url": "<string>",
  "auth_type": "api_key",
  "api_key": "<string>",
  "catalog_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "models": ["gpt-4o-mini", "gpt-4o"],
  "settings": {},
  "credentials": {},
  "request_timeout_secs": 1800,
  "stream_idle_timeout_secs": 900
}

A Provider

A Provider is a named upstream that authenticates with one credential and serves a model family. Provider creation supports two modes:

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>.

Example

curl -X POST https://app.barndoor.ai/api/llm-gateway/admin/providers \
  -H "Authorization: Bearer $BARNDOOR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "OpenAI Production (US)",
    "model_provider": "openai",
    "base_url": "https://api.openai.com/v1",
    "connection_id": "4f8b2a3c-12ee-4d92-9c7b-e7d2f8b0a111",
    "models": ["gpt-4o-mini", "gpt-4o", "text-embedding-3-large"]
  }'

Authorizations

Authorization

string

header

required

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

application/json

Body Fields