curl --request PUT \
--url https://{host}/api/llm-gateway/admin/model-access/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"change_note": "<string>",
"enabled": true,
"name": "<string>",
"policy_type": "<string>",
"scope_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope_type": "<string>",
"scope_value": "<string>",
"targets": [
{
"alias": "<string>",
"kind": "model_alias"
}
],
"traffic_type": "<string>"
}
'import requests
url = "https://{host}/api/llm-gateway/admin/model-access/{id}"
payload = {
"change_note": "<string>",
"enabled": True,
"name": "<string>",
"policy_type": "<string>",
"scope_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope_type": "<string>",
"scope_value": "<string>",
"targets": [
{
"alias": "<string>",
"kind": "model_alias"
}
],
"traffic_type": "<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({
change_note: '<string>',
enabled: true,
name: '<string>',
policy_type: '<string>',
scope_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
scope_type: '<string>',
scope_value: '<string>',
targets: [{alias: '<string>', kind: 'model_alias'}],
traffic_type: '<string>'
})
};
fetch('https://{host}/api/llm-gateway/admin/model-access/{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-access/{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([
'change_note' => '<string>',
'enabled' => true,
'name' => '<string>',
'policy_type' => '<string>',
'scope_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'scope_type' => '<string>',
'scope_value' => '<string>',
'targets' => [
[
'alias' => '<string>',
'kind' => 'model_alias'
]
],
'traffic_type' => '<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-access/{id}"
payload := strings.NewReader("{\n \"change_note\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"policy_type\": \"<string>\",\n \"scope_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope_type\": \"<string>\",\n \"scope_value\": \"<string>\",\n \"targets\": [\n {\n \"alias\": \"<string>\",\n \"kind\": \"model_alias\"\n }\n ],\n \"traffic_type\": \"<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-access/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"change_note\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"policy_type\": \"<string>\",\n \"scope_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope_type\": \"<string>\",\n \"scope_value\": \"<string>\",\n \"targets\": [\n {\n \"alias\": \"<string>\",\n \"kind\": \"model_alias\"\n }\n ],\n \"traffic_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/llm-gateway/admin/model-access/{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 \"change_note\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"policy_type\": \"<string>\",\n \"scope_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope_type\": \"<string>\",\n \"scope_value\": \"<string>\",\n \"targets\": [\n {\n \"alias\": \"<string>\",\n \"kind\": \"model_alias\"\n }\n ],\n \"traffic_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_type": "<string>",
"scope_type": "<string>",
"targets": [
{
"alias": "<string>",
"kind": "model_alias"
}
],
"traffic_type": "<string>",
"scope_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope_value": "<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"
}{
"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 access policy
Updates a model access policy. Only the fields you send are changed. Send null for scope_id or scope_value to unbind the policy from a single entity.
curl --request PUT \
--url https://{host}/api/llm-gateway/admin/model-access/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"change_note": "<string>",
"enabled": true,
"name": "<string>",
"policy_type": "<string>",
"scope_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope_type": "<string>",
"scope_value": "<string>",
"targets": [
{
"alias": "<string>",
"kind": "model_alias"
}
],
"traffic_type": "<string>"
}
'import requests
url = "https://{host}/api/llm-gateway/admin/model-access/{id}"
payload = {
"change_note": "<string>",
"enabled": True,
"name": "<string>",
"policy_type": "<string>",
"scope_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope_type": "<string>",
"scope_value": "<string>",
"targets": [
{
"alias": "<string>",
"kind": "model_alias"
}
],
"traffic_type": "<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({
change_note: '<string>',
enabled: true,
name: '<string>',
policy_type: '<string>',
scope_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
scope_type: '<string>',
scope_value: '<string>',
targets: [{alias: '<string>', kind: 'model_alias'}],
traffic_type: '<string>'
})
};
fetch('https://{host}/api/llm-gateway/admin/model-access/{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-access/{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([
'change_note' => '<string>',
'enabled' => true,
'name' => '<string>',
'policy_type' => '<string>',
'scope_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'scope_type' => '<string>',
'scope_value' => '<string>',
'targets' => [
[
'alias' => '<string>',
'kind' => 'model_alias'
]
],
'traffic_type' => '<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-access/{id}"
payload := strings.NewReader("{\n \"change_note\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"policy_type\": \"<string>\",\n \"scope_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope_type\": \"<string>\",\n \"scope_value\": \"<string>\",\n \"targets\": [\n {\n \"alias\": \"<string>\",\n \"kind\": \"model_alias\"\n }\n ],\n \"traffic_type\": \"<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-access/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"change_note\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"policy_type\": \"<string>\",\n \"scope_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope_type\": \"<string>\",\n \"scope_value\": \"<string>\",\n \"targets\": [\n {\n \"alias\": \"<string>\",\n \"kind\": \"model_alias\"\n }\n ],\n \"traffic_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/llm-gateway/admin/model-access/{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 \"change_note\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"policy_type\": \"<string>\",\n \"scope_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"scope_type\": \"<string>\",\n \"scope_value\": \"<string>\",\n \"targets\": [\n {\n \"alias\": \"<string>\",\n \"kind\": \"model_alias\"\n }\n ],\n \"traffic_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_type": "<string>",
"scope_type": "<string>",
"targets": [
{
"alias": "<string>",
"kind": "model_alias"
}
],
"traffic_type": "<string>",
"scope_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope_value": "<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"
}{
"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.
UUID of the scoped entity, for UUID-keyed scope types such as user, team, or api_key. Omit to leave unchanged; send null to clear.
Name of the scoped entity, for name-keyed scope types, such as a role or IdP group name. Omit to leave unchanged; send null to clear.
One thing a model access policy allows or denies, selected by kind.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Show child attributes
Show child attributes
Response
OK
A model access policy.
One thing a model access policy allows or denies, selected by kind.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Show child attributes
Show child attributes
Note explaining the last change.
When the last attributed change was made.