curl --request GET \
--url https://{host}/api/llm-gateway/admin/model-pricing \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/llm-gateway/admin/model-pricing"
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/model-pricing', 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-pricing",
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/model-pricing"
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/model-pricing")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/llm-gateway/admin/model-pricing")
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[
{
"effective_from": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input_cost_per_million_tokens": 123,
"model_pattern": "<string>",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"output_cost_per_million_tokens": 123,
"change_source": "admin_create",
"is_archived": true,
"sync_mode": "tracking",
"scheduled_count": 123,
"version_count": 123,
"cache_read_cost_per_million_tokens": 123,
"cache_write_cost_per_million_tokens": 123,
"catalog_slug": "<string>",
"long_context": {
"input_cost_per_million_tokens": 123,
"output_cost_per_million_tokens": 123,
"threshold_prompt_tokens": 123,
"cache_read_cost_per_million_tokens": 123,
"cache_write_cost_per_million_tokens": 123
},
"model_provider": "<string>",
"provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_name": "<string>",
"change_reason": "<string>",
"created_by_email": "<string>",
"created_by_name": "<string>",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"next_scheduled_effective_from": "2023-11-07T05:31:56Z"
}
]{
"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 pricing rules
One row per pricing rule, each showing the currently effective version, a version_count, and a scheduled_count of future-dated changes waiting to activate. Archived rules are not included.
curl --request GET \
--url https://{host}/api/llm-gateway/admin/model-pricing \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/api/llm-gateway/admin/model-pricing"
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/model-pricing', 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-pricing",
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/model-pricing"
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/model-pricing")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/llm-gateway/admin/model-pricing")
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[
{
"effective_from": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input_cost_per_million_tokens": 123,
"model_pattern": "<string>",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"output_cost_per_million_tokens": 123,
"change_source": "admin_create",
"is_archived": true,
"sync_mode": "tracking",
"scheduled_count": 123,
"version_count": 123,
"cache_read_cost_per_million_tokens": 123,
"cache_write_cost_per_million_tokens": 123,
"catalog_slug": "<string>",
"long_context": {
"input_cost_per_million_tokens": 123,
"output_cost_per_million_tokens": 123,
"threshold_prompt_tokens": 123,
"cache_read_cost_per_million_tokens": 123,
"cache_write_cost_per_million_tokens": 123
},
"model_provider": "<string>",
"provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_name": "<string>",
"change_reason": "<string>",
"created_by_email": "<string>",
"created_by_name": "<string>",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"next_scheduled_effective_from": "2023-11-07T05:31:56Z"
}
]{
"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
When this version takes effect. The version with the latest effective_from in the past is the one billed.
How a pricing version was created: admin_create, admin_edit, admin_schedule, import, sync_manual, sync_auto, admin_archive, or admin_restore.
admin_create, admin_edit, admin_schedule, import, sync_manual, sync_auto, admin_archive, admin_restore True for the version that archived the rule. Archived rules are excluded from GET /admin/model-pricing.
How the rule reacts to changes in Barndoor's default pricing.
tracking, pinned, auto Future-dated versions waiting to activate.
Total versions in this rule's history, including the current one.
Rate for input tokens read from the prompt cache. Null means cached input is billed at the input rate.
Rate for input tokens written to the prompt cache. Null means no separate rate.
Catalog slug for provider-level pricing (e.g. "openai", "aws_bedrock").
Optional higher rate set for large prompts.
Show child attributes
Show child attributes
Optional reference to a specific LLM Gateway provider instance.
Free-text note recorded with this version.
When the next scheduled version takes effect, if any.