Get usage
curl --request GET \
--url https://cloud.laravel.com/api/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud.laravel.com/api/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud.laravel.com/api/usage', 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://cloud.laravel.com/api/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://cloud.laravel.com/api/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cloud.laravel.com/api/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.laravel.com/api/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"summary": {
"current_spend_cents": 123,
"bandwidth": {
"cost_cents": 123,
"usage_percentage": 123,
"allowance_bytes": 123
},
"credits": {
"used_cents": 123,
"total_cents": 123
},
"alert": {
"threshold_cents": 123,
"remaining_percentage": 123
}
},
"resources": {
"total_cost_cents": 123,
"databases": [
{}
],
"caches": [
{}
],
"buckets": [
{}
],
"websockets": [
{}
]
},
"addons": {
"total_cost_cents": 123,
"items": [
{
"name": "<string>",
"total_cents": 123
}
]
},
"application_totals": {
"total_cost_cents": 123,
"application_count": 123,
"applications": [
{}
]
},
"environment_usage": {
"total_cost_cents": 123,
"items": [
{}
]
},
"private_cloud": {
"total_cost_cents": 123,
"sections": {},
"instances": {}
}
},
"meta": {
"currency": "<string>",
"period": 123,
"available_periods": [
{
"from": "<string>",
"to": "<string>"
}
],
"last_updated_at": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Usage
Get usage
Get billing and usage data for the authenticated organization.
GET
/
usage
Get usage
curl --request GET \
--url https://cloud.laravel.com/api/usage \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud.laravel.com/api/usage"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud.laravel.com/api/usage', 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://cloud.laravel.com/api/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://cloud.laravel.com/api/usage"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://cloud.laravel.com/api/usage")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.laravel.com/api/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"summary": {
"current_spend_cents": 123,
"bandwidth": {
"cost_cents": 123,
"usage_percentage": 123,
"allowance_bytes": 123
},
"credits": {
"used_cents": 123,
"total_cents": 123
},
"alert": {
"threshold_cents": 123,
"remaining_percentage": 123
}
},
"resources": {
"total_cost_cents": 123,
"databases": [
{}
],
"caches": [
{}
],
"buckets": [
{}
],
"websockets": [
{}
]
},
"addons": {
"total_cost_cents": 123,
"items": [
{
"name": "<string>",
"total_cents": 123
}
]
},
"application_totals": {
"total_cost_cents": 123,
"application_count": 123,
"applications": [
{}
]
},
"environment_usage": {
"total_cost_cents": 123,
"items": [
{}
]
},
"private_cloud": {
"total_cost_cents": 123,
"sections": {},
"instances": {}
}
},
"meta": {
"currency": "<string>",
"period": 123,
"available_periods": [
{
"from": "<string>",
"to": "<string>"
}
],
"last_updated_at": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
The Bearer Token generated on the Cloud UI.
Query Parameters
The billing period offset. 0 returns the current billing period, 1 returns the previous period, and so on. Periods are not necessarily month-long — they match your billing cycle. Must be between 0 and 3.
Required range:
0 <= x <= 3Was this page helpful?
⌘I

