curl --request POST \
--url https://api.veryfront.com/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scope": {
"project_reference": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"monthly_limit_credits": 500,
"monthly_limit_usd": 50
}
'import requests
url = "https://api.veryfront.com/budgets"
payload = {
"scope": {
"project_reference": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"monthly_limit_credits": 500,
"monthly_limit_usd": 50
}
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({
scope: {
project_reference: '<string>',
user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
api_key_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
monthly_limit_credits: 500,
monthly_limit_usd: 50
})
};
fetch('https://api.veryfront.com/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.veryfront.com/budgets",
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([
'scope' => [
'project_reference' => '<string>',
'user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'api_key_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'monthly_limit_credits' => 500,
'monthly_limit_usd' => 50
]),
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.veryfront.com/budgets"
payload := strings.NewReader("{\n \"scope\": {\n \"project_reference\": \"<string>\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"api_key_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"monthly_limit_credits\": 500,\n \"monthly_limit_usd\": 50\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.veryfront.com/budgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scope\": {\n \"project_reference\": \"<string>\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"api_key_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"monthly_limit_credits\": 500,\n \"monthly_limit_usd\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.veryfront.com/budgets")
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 \"scope\": {\n \"project_reference\": \"<string>\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"api_key_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"monthly_limit_credits\": 500,\n \"monthly_limit_usd\": 50\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": {
"kind": "api_key",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"monthly_limit_usd": 123,
"monthly_limit_credits": 123,
"status": {
"used": 123,
"remaining": 123,
"resets_at": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}Create budget
Creates a monthly AI spending limit. Usage already recorded this month counts toward the limit. Only one budget is allowed per scope; use PATCH to change an existing limit.
A budget caps monthly AI spending for a project, person, API key, or combination of these fields. A request must match every field in the budget scope. If several budgets apply, the most specific exhausted budget rejects the request before account credit and provider spending checks.
curl --request POST \
--url https://api.veryfront.com/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"scope": {
"project_reference": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"monthly_limit_credits": 500,
"monthly_limit_usd": 50
}
'import requests
url = "https://api.veryfront.com/budgets"
payload = {
"scope": {
"project_reference": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"monthly_limit_credits": 500,
"monthly_limit_usd": 50
}
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({
scope: {
project_reference: '<string>',
user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
api_key_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
monthly_limit_credits: 500,
monthly_limit_usd: 50
})
};
fetch('https://api.veryfront.com/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.veryfront.com/budgets",
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([
'scope' => [
'project_reference' => '<string>',
'user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'api_key_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'monthly_limit_credits' => 500,
'monthly_limit_usd' => 50
]),
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.veryfront.com/budgets"
payload := strings.NewReader("{\n \"scope\": {\n \"project_reference\": \"<string>\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"api_key_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"monthly_limit_credits\": 500,\n \"monthly_limit_usd\": 50\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.veryfront.com/budgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"scope\": {\n \"project_reference\": \"<string>\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"api_key_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"monthly_limit_credits\": 500,\n \"monthly_limit_usd\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.veryfront.com/budgets")
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 \"scope\": {\n \"project_reference\": \"<string>\",\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"api_key_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"monthly_limit_credits\": 500,\n \"monthly_limit_usd\": 50\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scope": {
"kind": "api_key",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"api_key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"monthly_limit_usd": 123,
"monthly_limit_credits": 123,
"status": {
"used": 123,
"remaining": 123,
"resets_at": "<string>"
},
"created_at": "<string>",
"updated_at": "<string>"
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}Authorizations
Use a JWT bearer token or a Veryfront API key in the Authorization header.
Body
Show child attributes
Show child attributes
Monthly AI spending limit in credits, the unit spend is counted in. At most 8589934591.999999 credits, with at most six decimal places. A value of 0 blocks all spending within the scope. Provide exactly one of monthly_limit_credits or monthly_limit_usd.
0 <= x <= 8589934591.999999500
Deprecated. Use monthly_limit_credits. Monthly AI spending limit in USD, converted to credits at the published credit price. At most 858993459.1999999 USD, the most that converts within the credit maximum. A value of 0 blocks all spending within the scope. Provide exactly one of monthly_limit_credits or monthly_limit_usd.
0 <= x <= 858993459.199999950
Response
Budget created
Show child attributes
Show child attributes
The monthly AI spend limit, in USD
The same limit in credits, the unit spend is counted in
Usage against the budget for the current month, or null if the subject has no budget.
Show child attributes
Show child attributes