Simulate gateway budgets
curl --request POST \
--url https://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": "alice@team-1.com",
"virtual_account": "my-virtual-account",
"team": "engineering",
"teams": [
"engineering",
"platform"
],
"model": "openai/gpt-4o",
"metadata": {
"environment": "production",
"cost_centre": "cc-engineering"
}
}
'import requests
url = "https://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate"
payload = {
"user": "alice@team-1.com",
"virtual_account": "my-virtual-account",
"team": "engineering",
"teams": ["engineering", "platform"],
"model": "openai/gpt-4o",
"metadata": {
"environment": "production",
"cost_centre": "cc-engineering"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user: 'alice@team-1.com',
virtual_account: 'my-virtual-account',
team: 'engineering',
teams: ['engineering', 'platform'],
model: 'openai/gpt-4o',
metadata: {environment: 'production', cost_centre: 'cc-engineering'}
})
};
fetch('https://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate', 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://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user' => 'alice@team-1.com',
'virtual_account' => 'my-virtual-account',
'team' => 'engineering',
'teams' => [
'engineering',
'platform'
],
'model' => 'openai/gpt-4o',
'metadata' => [
'environment' => 'production',
'cost_centre' => 'cc-engineering'
]
]),
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://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate"
payload := strings.NewReader("{\n \"user\": \"alice@team-1.com\",\n \"virtual_account\": \"my-virtual-account\",\n \"team\": \"engineering\",\n \"teams\": [\n \"engineering\",\n \"platform\"\n ],\n \"model\": \"openai/gpt-4o\",\n \"metadata\": {\n \"environment\": \"production\",\n \"cost_centre\": \"cc-engineering\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user\": \"alice@team-1.com\",\n \"virtual_account\": \"my-virtual-account\",\n \"team\": \"engineering\",\n \"teams\": [\n \"engineering\",\n \"platform\"\n ],\n \"model\": \"openai/gpt-4o\",\n \"metadata\": {\n \"environment\": \"production\",\n \"cost_centre\": \"cc-engineering\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user\": \"alice@team-1.com\",\n \"virtual_account\": \"my-virtual-account\",\n \"team\": \"engineering\",\n \"teams\": [\n \"engineering\",\n \"platform\"\n ],\n \"model\": \"openai/gpt-4o\",\n \"metadata\": {\n \"environment\": \"production\",\n \"cost_centre\": \"cc-engineering\"\n }\n}"
response = http.request(request)
puts response.read_body{
"matched": [
{
"name": "<string>",
"applies_to": "<string>",
"entities": [
{
"periods": {},
"entity": "{user:alice@co.com}"
}
],
"team_name": "<string>"
}
]
}LLM Gateway Budgets
Simulate gateway budgets
Returns the budgets that would apply to a hypothetical user/team/model/metadata selection, with current usage.
POST
/
api
/
svc
/
v1
/
llm-gateway
/
budgets
/
simulate
Simulate gateway budgets
curl --request POST \
--url https://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": "alice@team-1.com",
"virtual_account": "my-virtual-account",
"team": "engineering",
"teams": [
"engineering",
"platform"
],
"model": "openai/gpt-4o",
"metadata": {
"environment": "production",
"cost_centre": "cc-engineering"
}
}
'import requests
url = "https://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate"
payload = {
"user": "alice@team-1.com",
"virtual_account": "my-virtual-account",
"team": "engineering",
"teams": ["engineering", "platform"],
"model": "openai/gpt-4o",
"metadata": {
"environment": "production",
"cost_centre": "cc-engineering"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user: 'alice@team-1.com',
virtual_account: 'my-virtual-account',
team: 'engineering',
teams: ['engineering', 'platform'],
model: 'openai/gpt-4o',
metadata: {environment: 'production', cost_centre: 'cc-engineering'}
})
};
fetch('https://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate', 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://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user' => 'alice@team-1.com',
'virtual_account' => 'my-virtual-account',
'team' => 'engineering',
'teams' => [
'engineering',
'platform'
],
'model' => 'openai/gpt-4o',
'metadata' => [
'environment' => 'production',
'cost_centre' => 'cc-engineering'
]
]),
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://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate"
payload := strings.NewReader("{\n \"user\": \"alice@team-1.com\",\n \"virtual_account\": \"my-virtual-account\",\n \"team\": \"engineering\",\n \"teams\": [\n \"engineering\",\n \"platform\"\n ],\n \"model\": \"openai/gpt-4o\",\n \"metadata\": {\n \"environment\": \"production\",\n \"cost_centre\": \"cc-engineering\"\n }\n}")
req, _ := http.NewRequest("POST", 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.post("https://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user\": \"alice@team-1.com\",\n \"virtual_account\": \"my-virtual-account\",\n \"team\": \"engineering\",\n \"teams\": [\n \"engineering\",\n \"platform\"\n ],\n \"model\": \"openai/gpt-4o\",\n \"metadata\": {\n \"environment\": \"production\",\n \"cost_centre\": \"cc-engineering\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{controlPlaneURL}/api/svc/v1/llm-gateway/budgets/simulate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user\": \"alice@team-1.com\",\n \"virtual_account\": \"my-virtual-account\",\n \"team\": \"engineering\",\n \"teams\": [\n \"engineering\",\n \"platform\"\n ],\n \"model\": \"openai/gpt-4o\",\n \"metadata\": {\n \"environment\": \"production\",\n \"cost_centre\": \"cc-engineering\"\n }\n}"
response = http.request(request)
puts response.read_body{
"matched": [
{
"name": "<string>",
"applies_to": "<string>",
"entities": [
{
"periods": {},
"entity": "{user:alice@co.com}"
}
],
"team_name": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
User email to simulate as.
Example:
"alice@team-1.com"
Virtual account slug to simulate as. Use this instead of user for virtual-account budgets.
Example:
"my-virtual-account"
Single team to simulate membership of. Use teams to pass multiple teams.
Example:
"engineering"
All teams the simulated user belongs to. Merged with team when both are provided.
Example:
["engineering", "platform"]
Model to simulate.
Example:
"openai/gpt-4o"
Request metadata key/value pairs to simulate.
Show child attributes
Show child attributes
Example:
{
"environment": "production",
"cost_centre": "cc-engineering"
}
Response
200 - application/json
The budgets matching the selection.
Budgets that apply, with current usage.
Show child attributes
Show child attributes
Was this page helpful?
⌘I