Update Org Budget Settings
curl --request PATCH \
--url https://api.example.com/api/organizations/{org_id}/budgets \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: <api-key>' \
--data '
{
"enabled": true,
"monthly_limit": 1,
"reset_day": 123,
"default_user_monthly_limit": 1,
"slack_channel": "<string>",
"slack_team_id": "<string>",
"thresholds": [
{
"percentage": 99,
"email_enabled": true,
"slack_enabled": false
}
]
}
'import requests
url = "https://api.example.com/api/organizations/{org_id}/budgets"
payload = {
"enabled": True,
"monthly_limit": 1,
"reset_day": 123,
"default_user_monthly_limit": 1,
"slack_channel": "<string>",
"slack_team_id": "<string>",
"thresholds": [
{
"percentage": 99,
"email_enabled": True,
"slack_enabled": False
}
]
}
headers = {
"X-Access-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Access-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
monthly_limit: 1,
reset_day: 123,
default_user_monthly_limit: 1,
slack_channel: '<string>',
slack_team_id: '<string>',
thresholds: [{percentage: 99, email_enabled: true, slack_enabled: false}]
})
};
fetch('https://api.example.com/api/organizations/{org_id}/budgets', 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://api.example.com/api/organizations/{org_id}/budgets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'monthly_limit' => 1,
'reset_day' => 123,
'default_user_monthly_limit' => 1,
'slack_channel' => '<string>',
'slack_team_id' => '<string>',
'thresholds' => [
[
'percentage' => 99,
'email_enabled' => true,
'slack_enabled' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Token: <api-key>"
],
]);
$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://api.example.com/api/organizations/{org_id}/budgets"
payload := strings.NewReader("{\n \"enabled\": true,\n \"monthly_limit\": 1,\n \"reset_day\": 123,\n \"default_user_monthly_limit\": 1,\n \"slack_channel\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"thresholds\": [\n {\n \"percentage\": 99,\n \"email_enabled\": true,\n \"slack_enabled\": false\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Access-Token", "<api-key>")
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.patch("https://api.example.com/api/organizations/{org_id}/budgets")
.header("X-Access-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"monthly_limit\": 1,\n \"reset_day\": 123,\n \"default_user_monthly_limit\": 1,\n \"slack_channel\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"thresholds\": [\n {\n \"percentage\": 99,\n \"email_enabled\": true,\n \"slack_enabled\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/organizations/{org_id}/budgets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Access-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"monthly_limit\": 1,\n \"reset_day\": 123,\n \"default_user_monthly_limit\": 1,\n \"slack_channel\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"thresholds\": [\n {\n \"percentage\": 99,\n \"email_enabled\": true,\n \"slack_enabled\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"reset_day": 123,
"cycle_start_at": "2023-11-07T05:31:56Z",
"cycle_end_at": "2023-11-07T05:31:56Z",
"monthly_limit": 123,
"litellm_last_sync_at": "2023-11-07T05:31:56Z",
"litellm_last_sync_status": "<string>",
"litellm_last_sync_error": "<string>",
"slack_channel": "<string>",
"slack_team_id": "<string>",
"default_user_monthly_limit": 123,
"current_spend": 0,
"current_spend_percentage": 0,
"thresholds": [
{
"id": 123,
"percentage": 123,
"email_enabled": true,
"slack_enabled": true
}
],
"users": [
{
"user_id": "<string>",
"user_email": "<string>",
"user_name": "<string>",
"current_spend": 0,
"monthly_limit": 123,
"effective_monthly_limit": 123,
"is_disabled": false,
"is_override": false
}
],
"users_total": 0,
"users_page": 1,
"users_per_page": 50
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Orgs
Update Org Budget Settings
PATCH
/
api
/
organizations
/
{org_id}
/
budgets
Update Org Budget Settings
curl --request PATCH \
--url https://api.example.com/api/organizations/{org_id}/budgets \
--header 'Content-Type: application/json' \
--header 'X-Access-Token: <api-key>' \
--data '
{
"enabled": true,
"monthly_limit": 1,
"reset_day": 123,
"default_user_monthly_limit": 1,
"slack_channel": "<string>",
"slack_team_id": "<string>",
"thresholds": [
{
"percentage": 99,
"email_enabled": true,
"slack_enabled": false
}
]
}
'import requests
url = "https://api.example.com/api/organizations/{org_id}/budgets"
payload = {
"enabled": True,
"monthly_limit": 1,
"reset_day": 123,
"default_user_monthly_limit": 1,
"slack_channel": "<string>",
"slack_team_id": "<string>",
"thresholds": [
{
"percentage": 99,
"email_enabled": True,
"slack_enabled": False
}
]
}
headers = {
"X-Access-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Access-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
monthly_limit: 1,
reset_day: 123,
default_user_monthly_limit: 1,
slack_channel: '<string>',
slack_team_id: '<string>',
thresholds: [{percentage: 99, email_enabled: true, slack_enabled: false}]
})
};
fetch('https://api.example.com/api/organizations/{org_id}/budgets', 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://api.example.com/api/organizations/{org_id}/budgets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'monthly_limit' => 1,
'reset_day' => 123,
'default_user_monthly_limit' => 1,
'slack_channel' => '<string>',
'slack_team_id' => '<string>',
'thresholds' => [
[
'percentage' => 99,
'email_enabled' => true,
'slack_enabled' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Access-Token: <api-key>"
],
]);
$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://api.example.com/api/organizations/{org_id}/budgets"
payload := strings.NewReader("{\n \"enabled\": true,\n \"monthly_limit\": 1,\n \"reset_day\": 123,\n \"default_user_monthly_limit\": 1,\n \"slack_channel\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"thresholds\": [\n {\n \"percentage\": 99,\n \"email_enabled\": true,\n \"slack_enabled\": false\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Access-Token", "<api-key>")
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.patch("https://api.example.com/api/organizations/{org_id}/budgets")
.header("X-Access-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"monthly_limit\": 1,\n \"reset_day\": 123,\n \"default_user_monthly_limit\": 1,\n \"slack_channel\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"thresholds\": [\n {\n \"percentage\": 99,\n \"email_enabled\": true,\n \"slack_enabled\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/organizations/{org_id}/budgets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Access-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"monthly_limit\": 1,\n \"reset_day\": 123,\n \"default_user_monthly_limit\": 1,\n \"slack_channel\": \"<string>\",\n \"slack_team_id\": \"<string>\",\n \"thresholds\": [\n {\n \"percentage\": 99,\n \"email_enabled\": true,\n \"slack_enabled\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"enabled": true,
"reset_day": 123,
"cycle_start_at": "2023-11-07T05:31:56Z",
"cycle_end_at": "2023-11-07T05:31:56Z",
"monthly_limit": 123,
"litellm_last_sync_at": "2023-11-07T05:31:56Z",
"litellm_last_sync_status": "<string>",
"litellm_last_sync_error": "<string>",
"slack_channel": "<string>",
"slack_team_id": "<string>",
"default_user_monthly_limit": 123,
"current_spend": 0,
"current_spend_percentage": 0,
"thresholds": [
{
"id": 123,
"percentage": 123,
"email_enabled": true,
"slack_enabled": true
}
],
"users": [
{
"user_id": "<string>",
"user_email": "<string>",
"user_name": "<string>",
"current_spend": 0,
"monthly_limit": 123,
"effective_monthly_limit": 123,
"is_disabled": false,
"is_override": false
}
],
"users_total": 0,
"users_page": 1,
"users_per_page": 50
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
Path Parameters
Query Parameters
Required range:
x >= 1Required range:
1 <= x <= 1000Maximum string length:
200Body
application/json
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I

