Skip to main content
POST
Create a smart-model policy

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
model_alias
string
required
determiner_model_alias
string
required
slots
object[]
required
Minimum array length: 1
description
string
enabled
boolean
default:true
context_breakpoints
integer[]
determiner_input_max_chars
integer
default_slot_on_failure
integer

Response

The newly created policy

Picks one of several model aliases per request based on a determiner-model classification (e.g. send short prompts to a small model, long prompts to a larger one).

id
string<uuid>
required
org_id
string<uuid>
required
model_alias
string
required

The new alias clients call (must not collide with existing routes)

Example:

"smart-coder"

enabled
boolean
required
determiner_model_alias
string
required

The model the gateway uses to classify each request

Example:

"gpt-4o-mini"

slots
object[]
required
Minimum array length: 1
context_breakpoints
integer[]
required

Token counts at which the determiner switches between slots

Example:
determiner_input_max_chars
integer
required
Example:

2000

default_slot_on_failure
integer
required

Slot index used when the determiner fails or times out

description
string | null
created_at
string<date-time>
updated_at
string<date-time>