Create or replace the project's monthly spend limit
curl --request POST \
--url https://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_usd": "20.00",
"alert_threshold_basis_points": 5000
}
'import requests
url = "https://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit"
payload = {
"amount_usd": "20.00",
"alert_threshold_basis_points": 5000
}
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({amount_usd: '20.00', alert_threshold_basis_points: 5000})
};
fetch('https://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit', 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.antarah.dev/v1/organization/projects/{project_id}/spend_limit",
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([
'amount_usd' => '20.00',
'alert_threshold_basis_points' => 5000
]),
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://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit"
payload := strings.NewReader("{\n \"amount_usd\": \"20.00\",\n \"alert_threshold_basis_points\": 5000\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://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount_usd\": \"20.00\",\n \"alert_threshold_basis_points\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit")
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 \"amount_usd\": \"20.00\",\n \"alert_threshold_basis_points\": 5000\n}"
response = http.request(request)
puts response.read_body{
"id": "sl_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f",
"object": "organization.spend_limit",
"scope": "organization",
"project_id": "proj_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f",
"amount_usd": "12.50",
"period": "monthly",
"status": "active",
"alert_threshold_basis_points": 5000,
"created_at": 1793750400,
"updated_at": 1793750400
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"request_id": "<string>",
"param": "<string>",
"errors": [
{
"pointer": "<string>",
"detail": "<string>"
}
]
}Set a project's spend limit
POST
/
v1
/
organization
/
projects
/
{project_id}
/
spend_limit
Create or replace the project's monthly spend limit
curl --request POST \
--url https://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_usd": "20.00",
"alert_threshold_basis_points": 5000
}
'import requests
url = "https://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit"
payload = {
"amount_usd": "20.00",
"alert_threshold_basis_points": 5000
}
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({amount_usd: '20.00', alert_threshold_basis_points: 5000})
};
fetch('https://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit', 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.antarah.dev/v1/organization/projects/{project_id}/spend_limit",
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([
'amount_usd' => '20.00',
'alert_threshold_basis_points' => 5000
]),
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://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit"
payload := strings.NewReader("{\n \"amount_usd\": \"20.00\",\n \"alert_threshold_basis_points\": 5000\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://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount_usd\": \"20.00\",\n \"alert_threshold_basis_points\": 5000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.antarah.dev/v1/organization/projects/{project_id}/spend_limit")
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 \"amount_usd\": \"20.00\",\n \"alert_threshold_basis_points\": 5000\n}"
response = http.request(request)
puts response.read_body{
"id": "sl_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f",
"object": "organization.spend_limit",
"scope": "organization",
"project_id": "proj_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f",
"amount_usd": "12.50",
"period": "monthly",
"status": "active",
"alert_threshold_basis_points": 5000,
"created_at": 1793750400,
"updated_at": 1793750400
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"request_id": "<string>",
"param": "<string>",
"errors": [
{
"pointer": "<string>",
"detail": "<string>"
}
]
}Authorizations
adminKeysession
ak_admin_… Admin API key
Path Parameters
Pattern:
^proj_[0-9a-f]{32}$Example:
"proj_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f"
Body
application/json
Response
object | null
OK
Pattern:
^sl_[0-9a-f]{32}$Example:
"sl_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f"
Available options:
organization.spend_limit Available options:
organization, project Pattern:
^proj_[0-9a-f]{32}$Example:
"proj_0193a6c2e7b47c3d9f1e2a4b5c6d7e8f"
Pattern:
^\d+\.\d{2}(\d{0,3}[1-9])?$Example:
"12.50"
Available options:
monthly Available options:
active Required range:
0 <= x <= 10000Unix seconds
Example:
1793750400
Unix seconds
Example:
1793750400
