Get Billing Details
curl --request GET \
--url https://api.bunny.net/billing \
--header 'AccessKey: <api-key>'import requests
url = "https://api.bunny.net/billing"
headers = {"AccessKey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {AccessKey: '<api-key>'}};
fetch('https://api.bunny.net/billing', 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.bunny.net/billing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bunny.net/billing"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("AccessKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bunny.net/billing")
.header("AccessKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunny.net/billing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["AccessKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"Balance": 123,
"ThisMonthCharges": 123,
"LastRechargeBalance": 123,
"AvailableBalance": 123,
"CouponBalance": 123,
"MonthlyCouponUsage": 123,
"BillingRecords": [
{
"Id": 123,
"PaymentId": "<string>",
"Amount": 123,
"Payer": "<string>",
"Timestamp": "2023-11-07T05:31:56Z",
"Type": 0,
"InvoiceAvailable": true,
"DocumentDownloadUrl": "<string>",
"DetailedDocumentDownloadUrl": "<string>"
}
],
"BillingHistoryChart": {},
"MonthlyChargesEUTraffic": 123,
"MonthlyChargesUSTraffic": 123,
"MonthlyChargesASIATraffic": 123,
"MonthlyChargesAFTraffic": 123,
"MonthlyChargesSATraffic": 123,
"MonthlyChargesStorage": 123,
"MonthlyChargesDNS": 123,
"MonthlyChargesOptimizer": 123,
"MonthlyChargesTranscribe": 123,
"MonthlyChargesPremiumEncoding": 123,
"MonthlyChargesExtraPullZones": 123,
"MonthlyChargesExtraStorageZones": 123,
"MonthlyChargesExtraDnsZones": 123,
"MonthlyChargesExtraVideoLibraries": 123,
"MonthlyChargesScripting": 123,
"MonthlyChargesScriptingRequests": 123,
"MonthlyChargesScriptingCpu": 123,
"MonthlyChargesDrm": 123,
"MonthlyChargesMagicContainers": 123,
"MonthlyMcCpu": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyMcMemory": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyMcIp": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyMcIngressTraffic": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyMcEgressTraffic": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyMcVolumes": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyChargesShield": 123,
"MonthlyChargesTaxes": 123,
"MonthlyChargesWebSockets": 123,
"MonthlyChargesDB": 123,
"MonthlyChargesLoadBalancer": 123,
"MonthlyDBWrites": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyDBReads": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyDBStorage": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyDBReplica": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyChargesAiGateway": 123,
"MonthlyAiGatewayInputTokens": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyAiGatewayOutputTokens": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyAiGatewayCachedTokens": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyAiGatewayOtherCharges": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyBandwidthUsed": 123,
"MonthlyDnsSmartQueriesServed": 123,
"MonthlyDnsNormalQueriesServed": 123,
"MonthlyTranscriptionMinutes": 123,
"MonthlyPremiumEncodingBillableMinutes": 123,
"MonthlyDRMLicensesIssued": 123,
"MonthlyScriptingRequests": 123,
"MonthlyScriptingCpuTime": 123,
"BillingEnabled": true,
"MinimumMonthlyCommit": 123,
"VATRate": 123,
"NextMonthVATRate": 123,
"AutomaticPaymentImageUrl": "<string>",
"AutomaticPaymentCardType": "<string>",
"AutomaticPaymentIdentifier": "<string>",
"AutomaticPaymentAmount": 123,
"AutomaticRechargeTreshold": 123,
"AutomaticRechargeEnabled": true,
"AutomaticPaymentFailureCount": 123,
"SavedPaymentMethods": [
{
"Token": "<string>",
"ImageUrl": "<string>",
"ExpirationDate": "<string>",
"LastFour": "<string>",
"Email": "<string>"
}
],
"EUUSDiscount": 123,
"SouthAmericaDiscount": 123,
"AfricaDiscount": 123,
"AsiaOceaniaDiscount": 123,
"OptimizerMonthlyPrice": 123,
"DrmBaseMonthlyPrice": 123,
"DrmCostPerLicense": 123
}Billing
Get Billing Details
Get the billing status details
GET
/
billing
Get Billing Details
curl --request GET \
--url https://api.bunny.net/billing \
--header 'AccessKey: <api-key>'import requests
url = "https://api.bunny.net/billing"
headers = {"AccessKey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {AccessKey: '<api-key>'}};
fetch('https://api.bunny.net/billing', 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.bunny.net/billing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bunny.net/billing"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("AccessKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.bunny.net/billing")
.header("AccessKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunny.net/billing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["AccessKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"Balance": 123,
"ThisMonthCharges": 123,
"LastRechargeBalance": 123,
"AvailableBalance": 123,
"CouponBalance": 123,
"MonthlyCouponUsage": 123,
"BillingRecords": [
{
"Id": 123,
"PaymentId": "<string>",
"Amount": 123,
"Payer": "<string>",
"Timestamp": "2023-11-07T05:31:56Z",
"Type": 0,
"InvoiceAvailable": true,
"DocumentDownloadUrl": "<string>",
"DetailedDocumentDownloadUrl": "<string>"
}
],
"BillingHistoryChart": {},
"MonthlyChargesEUTraffic": 123,
"MonthlyChargesUSTraffic": 123,
"MonthlyChargesASIATraffic": 123,
"MonthlyChargesAFTraffic": 123,
"MonthlyChargesSATraffic": 123,
"MonthlyChargesStorage": 123,
"MonthlyChargesDNS": 123,
"MonthlyChargesOptimizer": 123,
"MonthlyChargesTranscribe": 123,
"MonthlyChargesPremiumEncoding": 123,
"MonthlyChargesExtraPullZones": 123,
"MonthlyChargesExtraStorageZones": 123,
"MonthlyChargesExtraDnsZones": 123,
"MonthlyChargesExtraVideoLibraries": 123,
"MonthlyChargesScripting": 123,
"MonthlyChargesScriptingRequests": 123,
"MonthlyChargesScriptingCpu": 123,
"MonthlyChargesDrm": 123,
"MonthlyChargesMagicContainers": 123,
"MonthlyMcCpu": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyMcMemory": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyMcIp": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyMcIngressTraffic": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyMcEgressTraffic": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyMcVolumes": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyChargesShield": 123,
"MonthlyChargesTaxes": 123,
"MonthlyChargesWebSockets": 123,
"MonthlyChargesDB": 123,
"MonthlyChargesLoadBalancer": 123,
"MonthlyDBWrites": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyDBReads": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyDBStorage": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyDBReplica": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyChargesAiGateway": 123,
"MonthlyAiGatewayInputTokens": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyAiGatewayOutputTokens": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyAiGatewayCachedTokens": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyAiGatewayOtherCharges": {
"Usage": 123,
"TotalUnits": 123,
"MeasuringUnit": "<string>"
},
"MonthlyBandwidthUsed": 123,
"MonthlyDnsSmartQueriesServed": 123,
"MonthlyDnsNormalQueriesServed": 123,
"MonthlyTranscriptionMinutes": 123,
"MonthlyPremiumEncodingBillableMinutes": 123,
"MonthlyDRMLicensesIssued": 123,
"MonthlyScriptingRequests": 123,
"MonthlyScriptingCpuTime": 123,
"BillingEnabled": true,
"MinimumMonthlyCommit": 123,
"VATRate": 123,
"NextMonthVATRate": 123,
"AutomaticPaymentImageUrl": "<string>",
"AutomaticPaymentCardType": "<string>",
"AutomaticPaymentIdentifier": "<string>",
"AutomaticPaymentAmount": 123,
"AutomaticRechargeTreshold": 123,
"AutomaticRechargeEnabled": true,
"AutomaticPaymentFailureCount": 123,
"SavedPaymentMethods": [
{
"Token": "<string>",
"ImageUrl": "<string>",
"ExpirationDate": "<string>",
"LastFour": "<string>",
"Email": "<string>"
}
],
"EUUSDiscount": 123,
"SouthAmericaDiscount": 123,
"AfricaDiscount": 123,
"AsiaOceaniaDiscount": 123,
"OptimizerMonthlyPrice": 123,
"DrmBaseMonthlyPrice": 123,
"DrmCostPerLicense": 123
}Scopes
Response
Get the billing status details