curl --request GET \
--url https://{host}/api/llm-gateway/admin/routing-policies \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/llm-gateway/admin/routing-policies"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/llm-gateway/admin/routing-policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/llm-gateway/admin/routing-policies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/llm-gateway/admin/routing-policies"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/llm-gateway/admin/routing-policies")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/llm-gateway/admin/routing-policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"context_breakpoints": [
123
],
"created_at": "2023-11-07T05:31:56Z",
"default_slot_on_failure": 123,
"enabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_alias": "<string>",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"posture": "savings",
"router_input_max_chars": 123,
"slots": [
{
"model_alias": "<string>",
"description": "<string>",
"label": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"determiner_model_alias": "<string>",
"determiner_prompt": "<string>"
}
]{
"error": {
"message": "retry_on_429_count must be between 0 and 10",
"type": "invalid_request_error"
}
}{
"error": {
"message": "retry_on_429_count must be between 0 and 10",
"type": "invalid_request_error"
}
}List routing policies
Returns every routing policy in the organization. A routing policy is a model alias that, when called, picks one of several model slots per request.
curl --request GET \
--url https://{host}/api/llm-gateway/admin/routing-policies \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/llm-gateway/admin/routing-policies"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/api/llm-gateway/admin/routing-policies', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/llm-gateway/admin/routing-policies",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/llm-gateway/admin/routing-policies"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/llm-gateway/admin/routing-policies")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/llm-gateway/admin/routing-policies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"context_breakpoints": [
123
],
"created_at": "2023-11-07T05:31:56Z",
"default_slot_on_failure": 123,
"enabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_alias": "<string>",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"posture": "savings",
"router_input_max_chars": 123,
"slots": [
{
"model_alias": "<string>",
"description": "<string>",
"label": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"determiner_model_alias": "<string>",
"determiner_prompt": "<string>"
}
]{
"error": {
"message": "retry_on_429_count must be between 0 and 10",
"type": "invalid_request_error"
}
}{
"error": {
"message": "retry_on_429_count must be between 0 and 10",
"type": "invalid_request_error"
}
}Authorizations
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.
Response
OK
Prompt sizes, in tokens, that set a minimum slot for very large requests. There is one fewer entry than slots, in strictly increasing order. Defaults to [128000, 512000].
Slot used when the determiner cannot make a choice. Defaults to 1.
The alias callers send in model to use this policy.
Which way the policy leans when the choice between slots is close.
savings, balanced, quality How many characters of the request the determiner reads. Defaults to 12000.
The models the policy chooses between, in order from the lightest to the most capable. Slot numbers elsewhere are 0-based positions in this list.
Show child attributes
Show child attributes
The model that reads each request and picks a slot.
Optional replacement for the determiner's built-in instructions. The slot list and output format are always added by the gateway.