curl --request PATCH \
--url https://api.monid.ai/v1/controls/workspace/budgets/{budgetControlId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.monid.ai/v1/controls/workspace/budgets/{budgetControlId}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.monid.ai/v1/controls/workspace/budgets/{budgetControlId}', 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.monid.ai/v1/controls/workspace/budgets/{budgetControlId}",
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([
]),
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.monid.ai/v1/controls/workspace/budgets/{budgetControlId}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.monid.ai/v1/controls/workspace/budgets/{budgetControlId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monid.ai/v1/controls/workspace/budgets/{budgetControlId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"budgetControlId": "01JC2Z0A9V8Q4R6T8Y0B2D4F6H",
"workspaceId": "<string>",
"period": "HOUR",
"limitAmount": 100,
"spentAmount": 123,
"heldAmount": 123,
"availableAmount": 123,
"currency": "USD",
"windowStart": "2023-11-07T05:31:56Z",
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}Update a workspace budget control
Patch limitAmount and/or status. At least one field is required.
curl --request PATCH \
--url https://api.monid.ai/v1/controls/workspace/budgets/{budgetControlId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.monid.ai/v1/controls/workspace/budgets/{budgetControlId}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.monid.ai/v1/controls/workspace/budgets/{budgetControlId}', 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.monid.ai/v1/controls/workspace/budgets/{budgetControlId}",
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([
]),
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.monid.ai/v1/controls/workspace/budgets/{budgetControlId}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.monid.ai/v1/controls/workspace/budgets/{budgetControlId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monid.ai/v1/controls/workspace/budgets/{budgetControlId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"budgetControlId": "01JC2Z0A9V8Q4R6T8Y0B2D4F6H",
"workspaceId": "<string>",
"period": "HOUR",
"limitAmount": 100,
"spentAmount": 123,
"heldAmount": 123,
"availableAmount": 123,
"currency": "USD",
"windowStart": "2023-11-07T05:31:56Z",
"status": "ACTIVE",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}Authorizations
Monid API key (Authorization: Bearer mk_...) or Clerk-issued JWT. Each operation lists the ONE scope an API key needs. {resource}:* grants every action on that resource; * grants everything; Clerk sessions hold *. Operations with an empty list need no scope. Scope catalog: GET /v1/api-keys/scopes.
Headers
Model driving the calling agent. Optional; a value that is empty, longer than 256 characters or not printable ASCII is ignored (never an error).
256Agent harness or client making the call (e.g. a coding agent, an agent framework). Optional; a value that is empty, longer than 256 characters or not printable ASCII is ignored (never an error).
256Caller-side session identifier, so the calls of one agent session (discover → inspect → run → polling) can be correlated. Optional; a value that is empty, longer than 256 characters or not printable ASCII is ignored (never an error).
256Path Parameters
Budget control ID (ULID).
"01JC2Z0A9V8Q4R6T8Y0B2D4F6H"
Body
Response
Updated budget control
Budget control ID (ULID).
"01JC2Z0A9V8Q4R6T8Y0B2D4F6H"
HOUR, DAY, WEEK, MONTH Budget cap for the window, in dollars.
100
Settled spend in the current window, in dollars.
Outstanding holds for in-flight runs, in dollars.
limitAmount - spentAmount - heldAmount, in dollars.
USD ISO 8601 — which window the counters represent.
ACTIVE, PAUSED