Skip to main content
POST
/
v1
/
budgets
/
requests
Submit a budget increase request
curl --request POST \
  --url https://api.example.com/v1/budgets/requests \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "virtualKeyId": "<string>",
  "fromUsd": 20,
  "toUsd": 50,
  "reason": "Need more budget for Q2 analysis job",
  "durationHours": 24
}
'
import requests

url = "https://api.example.com/v1/budgets/requests"

payload = {
"virtualKeyId": "<string>",
"fromUsd": 20,
"toUsd": 50,
"reason": "Need more budget for Q2 analysis job",
"durationHours": 24
}
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({
virtualKeyId: '<string>',
fromUsd: 20,
toUsd: 50,
reason: 'Need more budget for Q2 analysis job',
durationHours: 24
})
};

fetch('https://api.example.com/v1/budgets/requests', 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/v1/budgets/requests",
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([
'virtualKeyId' => '<string>',
'fromUsd' => 20,
'toUsd' => 50,
'reason' => 'Need more budget for Q2 analysis job',
'durationHours' => 24
]),
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.example.com/v1/budgets/requests"

payload := strings.NewReader("{\n \"virtualKeyId\": \"<string>\",\n \"fromUsd\": 20,\n \"toUsd\": 50,\n \"reason\": \"Need more budget for Q2 analysis job\",\n \"durationHours\": 24\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.example.com/v1/budgets/requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"virtualKeyId\": \"<string>\",\n \"fromUsd\": 20,\n \"toUsd\": 50,\n \"reason\": \"Need more budget for Q2 analysis job\",\n \"durationHours\": 24\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/budgets/requests")

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 \"virtualKeyId\": \"<string>\",\n \"fromUsd\": 20,\n \"toUsd\": 50,\n \"reason\": \"Need more budget for Q2 analysis job\",\n \"durationHours\": 24\n}"

response = http.request(request)
puts response.read_body

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
virtualKeyId
string
required
fromUsd
number
required
Example:

20

toUsd
number
required
Example:

50

reason
string
required
Example:

"Need more budget for Q2 analysis job"

durationHours
number

How long (hours) the elevated budget is needed. On approve the budget auto-reverts after this window. Default 24, max 720.

Example:

24

Response

201 - undefined