Skip to main content
POST
/
orgs
/
{org_id}
/
billing
/
overage
cURL
curl --request POST \
  --url https://api.timbal.ai/orgs/{org_id}/billing/overage \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "enabled": true,
  "cap_credits": 123
}
'
import requests

url = "https://api.timbal.ai/orgs/{org_id}/billing/overage"

payload = {
    "enabled": True,
    "cap_credits": 123
}
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({enabled: true, cap_credits: 123})
};

fetch('https://api.timbal.ai/orgs/{org_id}/billing/overage', 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.timbal.ai/orgs/{org_id}/billing/overage",
  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([
    'enabled' => true,
    'cap_credits' => 123
  ]),
  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.timbal.ai/orgs/{org_id}/billing/overage"

	payload := strings.NewReader("{\n  \"enabled\": true,\n  \"cap_credits\": 123\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.timbal.ai/orgs/{org_id}/billing/overage")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"enabled\": true,\n  \"cap_credits\": 123\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.timbal.ai/orgs/{org_id}/billing/overage")

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  \"enabled\": true,\n  \"cap_credits\": 123\n}"

response = http.request(request)
puts response.read_body
null
{
  "code": "<string>",
  "message": "<string>"
}
{
  "code": "<string>",
  "message": "<string>"
}
{
  "code": "<string>",
  "message": "<string>"
}
enabled turns usage-based overage on or off. cap_credits limits how many overage credits can accrue; omit it or set it to null for no cap.To read current-period overage usage (invoiced vs pending credits), see Get Overage Summary.

Authorizations

Authorization
string
header
required

Timbal API key. Obtain your API key from the Timbal platform settings. See Authentication for more information.

Path Parameters

org_id
string
required

Body

application/json
enabled
boolean
required
cap_credits
integer<int64> | null

Max overage credits the user allows (null = unlimited).

Response

Overage settings updated