curl --request PUT \
--url https://{host}/api/llm-gateway/admin/model-mappings/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bare_alias": true,
"change_note": "<string>",
"cooldown_429_default_secs": 123,
"cooldown_base_secs": 123,
"cooldown_failure_threshold": 123,
"cooldown_max_secs": 123,
"cooldown_overloaded_secs": 123,
"cooldown_window_secs": 123,
"enabled": true,
"model_alias": "<string>",
"priority": 123,
"request_timeout_secs": 123,
"retry_on_429_count": 123,
"retry_on_429_max_wait_secs": 123,
"stream_idle_timeout_secs": 123,
"upstream_model": "<string>"
}
'import requests
url = "https://{host}/api/llm-gateway/admin/model-mappings/{id}"
payload = {
"bare_alias": True,
"change_note": "<string>",
"cooldown_429_default_secs": 123,
"cooldown_base_secs": 123,
"cooldown_failure_threshold": 123,
"cooldown_max_secs": 123,
"cooldown_overloaded_secs": 123,
"cooldown_window_secs": 123,
"enabled": True,
"model_alias": "<string>",
"priority": 123,
"request_timeout_secs": 123,
"retry_on_429_count": 123,
"retry_on_429_max_wait_secs": 123,
"stream_idle_timeout_secs": 123,
"upstream_model": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bare_alias: true,
change_note: '<string>',
cooldown_429_default_secs: 123,
cooldown_base_secs: 123,
cooldown_failure_threshold: 123,
cooldown_max_secs: 123,
cooldown_overloaded_secs: 123,
cooldown_window_secs: 123,
enabled: true,
model_alias: '<string>',
priority: 123,
request_timeout_secs: 123,
retry_on_429_count: 123,
retry_on_429_max_wait_secs: 123,
stream_idle_timeout_secs: 123,
upstream_model: '<string>'
})
};
fetch('https://{host}/api/llm-gateway/admin/model-mappings/{id}', 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/model-mappings/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bare_alias' => true,
'change_note' => '<string>',
'cooldown_429_default_secs' => 123,
'cooldown_base_secs' => 123,
'cooldown_failure_threshold' => 123,
'cooldown_max_secs' => 123,
'cooldown_overloaded_secs' => 123,
'cooldown_window_secs' => 123,
'enabled' => true,
'model_alias' => '<string>',
'priority' => 123,
'request_timeout_secs' => 123,
'retry_on_429_count' => 123,
'retry_on_429_max_wait_secs' => 123,
'stream_idle_timeout_secs' => 123,
'upstream_model' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/llm-gateway/admin/model-mappings/{id}"
payload := strings.NewReader("{\n \"bare_alias\": true,\n \"change_note\": \"<string>\",\n \"cooldown_429_default_secs\": 123,\n \"cooldown_base_secs\": 123,\n \"cooldown_failure_threshold\": 123,\n \"cooldown_max_secs\": 123,\n \"cooldown_overloaded_secs\": 123,\n \"cooldown_window_secs\": 123,\n \"enabled\": true,\n \"model_alias\": \"<string>\",\n \"priority\": 123,\n \"request_timeout_secs\": 123,\n \"retry_on_429_count\": 123,\n \"retry_on_429_max_wait_secs\": 123,\n \"stream_idle_timeout_secs\": 123,\n \"upstream_model\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{host}/api/llm-gateway/admin/model-mappings/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bare_alias\": true,\n \"change_note\": \"<string>\",\n \"cooldown_429_default_secs\": 123,\n \"cooldown_base_secs\": 123,\n \"cooldown_failure_threshold\": 123,\n \"cooldown_max_secs\": 123,\n \"cooldown_overloaded_secs\": 123,\n \"cooldown_window_secs\": 123,\n \"enabled\": true,\n \"model_alias\": \"<string>\",\n \"priority\": 123,\n \"request_timeout_secs\": 123,\n \"retry_on_429_count\": 123,\n \"retry_on_429_max_wait_secs\": 123,\n \"stream_idle_timeout_secs\": 123,\n \"upstream_model\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/llm-gateway/admin/model-mappings/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bare_alias\": true,\n \"change_note\": \"<string>\",\n \"cooldown_429_default_secs\": 123,\n \"cooldown_base_secs\": 123,\n \"cooldown_failure_threshold\": 123,\n \"cooldown_max_secs\": 123,\n \"cooldown_overloaded_secs\": 123,\n \"cooldown_window_secs\": 123,\n \"enabled\": true,\n \"model_alias\": \"<string>\",\n \"priority\": 123,\n \"request_timeout_secs\": 123,\n \"retry_on_429_count\": 123,\n \"retry_on_429_max_wait_secs\": 123,\n \"stream_idle_timeout_secs\": 123,\n \"upstream_model\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"cooldown_429_default_secs": 123,
"cooldown_base_secs": 123,
"cooldown_failure_threshold": 123,
"cooldown_max_secs": 123,
"cooldown_overloaded_secs": 123,
"cooldown_window_secs": 123,
"bare_alias": true,
"enabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_alias": "<string>",
"priority": 123,
"provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_on_429_count": 123,
"retry_on_429_max_wait_secs": 123,
"source": "catalog",
"upstream_model": "<string>",
"created_by_email": "<string>",
"created_by_name": "<string>",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_change_note": "<string>",
"last_modified_at": "2023-11-07T05:31:56Z",
"last_modified_by_email": "<string>",
"last_modified_by_name": "<string>",
"last_modified_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"auto_disabled_reason": "catalog_retired",
"request_timeout_secs": 123,
"stream_idle_timeout_secs": 123
}{
"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"
}
}{
"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"
}
}{
"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"
}
}{
"error": {
"message": "retry_on_429_count must be between 0 and 10",
"type": "invalid_request_error"
}
}Update a model route
Updates a model route. Only the fields you send are changed. When your organization requires pricing for model routes, an enabled route must still match a pricing rule after the update; setting enabled: false is always allowed.
curl --request PUT \
--url https://{host}/api/llm-gateway/admin/model-mappings/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bare_alias": true,
"change_note": "<string>",
"cooldown_429_default_secs": 123,
"cooldown_base_secs": 123,
"cooldown_failure_threshold": 123,
"cooldown_max_secs": 123,
"cooldown_overloaded_secs": 123,
"cooldown_window_secs": 123,
"enabled": true,
"model_alias": "<string>",
"priority": 123,
"request_timeout_secs": 123,
"retry_on_429_count": 123,
"retry_on_429_max_wait_secs": 123,
"stream_idle_timeout_secs": 123,
"upstream_model": "<string>"
}
'import requests
url = "https://{host}/api/llm-gateway/admin/model-mappings/{id}"
payload = {
"bare_alias": True,
"change_note": "<string>",
"cooldown_429_default_secs": 123,
"cooldown_base_secs": 123,
"cooldown_failure_threshold": 123,
"cooldown_max_secs": 123,
"cooldown_overloaded_secs": 123,
"cooldown_window_secs": 123,
"enabled": True,
"model_alias": "<string>",
"priority": 123,
"request_timeout_secs": 123,
"retry_on_429_count": 123,
"retry_on_429_max_wait_secs": 123,
"stream_idle_timeout_secs": 123,
"upstream_model": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bare_alias: true,
change_note: '<string>',
cooldown_429_default_secs: 123,
cooldown_base_secs: 123,
cooldown_failure_threshold: 123,
cooldown_max_secs: 123,
cooldown_overloaded_secs: 123,
cooldown_window_secs: 123,
enabled: true,
model_alias: '<string>',
priority: 123,
request_timeout_secs: 123,
retry_on_429_count: 123,
retry_on_429_max_wait_secs: 123,
stream_idle_timeout_secs: 123,
upstream_model: '<string>'
})
};
fetch('https://{host}/api/llm-gateway/admin/model-mappings/{id}', 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/model-mappings/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bare_alias' => true,
'change_note' => '<string>',
'cooldown_429_default_secs' => 123,
'cooldown_base_secs' => 123,
'cooldown_failure_threshold' => 123,
'cooldown_max_secs' => 123,
'cooldown_overloaded_secs' => 123,
'cooldown_window_secs' => 123,
'enabled' => true,
'model_alias' => '<string>',
'priority' => 123,
'request_timeout_secs' => 123,
'retry_on_429_count' => 123,
'retry_on_429_max_wait_secs' => 123,
'stream_idle_timeout_secs' => 123,
'upstream_model' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/llm-gateway/admin/model-mappings/{id}"
payload := strings.NewReader("{\n \"bare_alias\": true,\n \"change_note\": \"<string>\",\n \"cooldown_429_default_secs\": 123,\n \"cooldown_base_secs\": 123,\n \"cooldown_failure_threshold\": 123,\n \"cooldown_max_secs\": 123,\n \"cooldown_overloaded_secs\": 123,\n \"cooldown_window_secs\": 123,\n \"enabled\": true,\n \"model_alias\": \"<string>\",\n \"priority\": 123,\n \"request_timeout_secs\": 123,\n \"retry_on_429_count\": 123,\n \"retry_on_429_max_wait_secs\": 123,\n \"stream_idle_timeout_secs\": 123,\n \"upstream_model\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{host}/api/llm-gateway/admin/model-mappings/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bare_alias\": true,\n \"change_note\": \"<string>\",\n \"cooldown_429_default_secs\": 123,\n \"cooldown_base_secs\": 123,\n \"cooldown_failure_threshold\": 123,\n \"cooldown_max_secs\": 123,\n \"cooldown_overloaded_secs\": 123,\n \"cooldown_window_secs\": 123,\n \"enabled\": true,\n \"model_alias\": \"<string>\",\n \"priority\": 123,\n \"request_timeout_secs\": 123,\n \"retry_on_429_count\": 123,\n \"retry_on_429_max_wait_secs\": 123,\n \"stream_idle_timeout_secs\": 123,\n \"upstream_model\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/llm-gateway/admin/model-mappings/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bare_alias\": true,\n \"change_note\": \"<string>\",\n \"cooldown_429_default_secs\": 123,\n \"cooldown_base_secs\": 123,\n \"cooldown_failure_threshold\": 123,\n \"cooldown_max_secs\": 123,\n \"cooldown_overloaded_secs\": 123,\n \"cooldown_window_secs\": 123,\n \"enabled\": true,\n \"model_alias\": \"<string>\",\n \"priority\": 123,\n \"request_timeout_secs\": 123,\n \"retry_on_429_count\": 123,\n \"retry_on_429_max_wait_secs\": 123,\n \"stream_idle_timeout_secs\": 123,\n \"upstream_model\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"cooldown_429_default_secs": 123,
"cooldown_base_secs": 123,
"cooldown_failure_threshold": 123,
"cooldown_max_secs": 123,
"cooldown_overloaded_secs": 123,
"cooldown_window_secs": 123,
"bare_alias": true,
"enabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"model_alias": "<string>",
"priority": 123,
"provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retry_on_429_count": 123,
"retry_on_429_max_wait_secs": 123,
"source": "catalog",
"upstream_model": "<string>",
"created_by_email": "<string>",
"created_by_name": "<string>",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_change_note": "<string>",
"last_modified_at": "2023-11-07T05:31:56Z",
"last_modified_by_email": "<string>",
"last_modified_by_name": "<string>",
"last_modified_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"auto_disabled_reason": "catalog_retired",
"request_timeout_secs": 123,
"stream_idle_timeout_secs": 123
}{
"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"
}
}{
"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"
}
}{
"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"
}
}{
"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.
Path Parameters
Record ID (UUID)
Body
Optional note explaining this change. Omitting it clears the previous note.
Same as on create. Omit to keep the stored value.
Same as on create. Omit to keep the stored value.
Same as on create. Omit to keep the stored value.
Same as on create. Omit to keep the stored value.
Same as on create. Omit to keep the stored value.
Same as on create. Omit to keep the stored value.
Total-request timeout for non-streaming requests, in seconds (1–600). Omit to leave unchanged; send null to clear.
Streaming idle timeout, in seconds (1–300). Omit to leave unchanged; send null to clear.
Response
OK
A model route.
Cooldown after an upstream 429 with no usable Retry-After, in seconds.
First cooldown window, in seconds. Doubles after each failed recovery probe, up to cooldown_max_secs.
Gateway failures within cooldown_window_secs that put the route in cooldown. 0 disables cooldowns for the route.
Longest cooldown window, in seconds.
Cooldown after an upstream 529 (overloaded) with no usable Retry-After, in seconds. 0 treats a 529 as an ordinary failure.
Length of the rolling failure window, in seconds.
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.
Failover order among routes serving the same alias; lower is tried first.
Same-route retries on upstream 429. 0 means immediate failover.
Longest upstream Retry-After to honor, in seconds. 0 uses a short built-in wait and ignores the header.
Whether the model was chosen from the catalog or typed in when the route was created.
catalog, custom Note explaining the last change.
When the last attributed change was made.
Set when the gateway disabled this route because the model left the provider's catalog. Any admin change to enabled clears it.
catalog_retired Total-request timeout for non-streaming requests, in seconds (1–600).
Idle timeout between chunks of a streaming response, in seconds (1–300).