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": [
{
"name": "<string>",
"identifier": "<string>",
"type": "<string>",
"storage": {
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{}
]
}
]
},
"compute": {
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{}
]
}
]
},
"data_transfer": {
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{}
]
}
]
},
"backup": {
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{}
]
}
]
},
"total_cents": 123,
"deleted": true
}
],
"caches": [
{
"name": "<string>",
"identifier": "<string>",
"type": "<string>",
"storage": "<string>",
"compute_cents": 123,
"compute_hours": 123,
"compute_seconds": 123,
"total_cents": 123,
"deleted": true
}
],
"buckets": [
{
"name": "<string>",
"identifier": "<string>",
"class_a_requests_cents": 123,
"class_a_requests_count": 123,
"class_b_requests_cents": 123,
"class_b_requests_count": 123,
"storage_cents": 123,
"storage_gb": 123,
"total_cents": 123,
"deleted": true
}
],
"websockets": [
{
"name": "<string>",
"identifier": "<string>",
"max_connections": 123,
"usage_time_cents": 123,
"usage_time_hours": 123,
"usage_time_seconds": 123,
"total_cents": 123,
"deleted": true
}
]
},
"addons": {
"total_cost_cents": 123,
"items": [
{
"name": "<string>",
"total_cents": 123
}
]
},
"application_totals": {
"total_cost_cents": 123,
"application_count": 123,
"applications": [
{
"identifier": "<string>",
"total_cost_cents": 123,
"environment_count": 123,
"deleted": true
}
]
},
"environment_usage": {
"total_cost_cents": 123,
"items": [
{
"identifier": "<string>",
"type": "<string>",
"compute_profile": "<string>",
"compute_description": "<string>",
"active_replicas": 123,
"total_replicas": 123,
"compute_hours": 123,
"cpu_hours": 123,
"compute_seconds": 123,
"total_cents": 123
}
],
"managed_queues": {
"total_cost_cents": 123,
"has_compute": true,
"has_operations": true,
"queues": [
{
"name": "<string>",
"compute_hours": 123,
"compute_seconds": 123,
"compute_cost_cents": 123,
"compute_sizes": [
{
"profile": "<string>",
"description": "<string>",
"hours": 123,
"seconds": 123,
"cost_cents": 123
}
],
"operations_count": 123,
"operations_millions": 123,
"operations_cost_cents": 123,
"total_cost_cents": 123
}
]
},
"log_drains": {
"total_cost_cents": 123,
"drains": [
{
"name": "<string>",
"type": "<string>",
"type_label": "<string>",
"compute_hours": 123,
"compute_seconds": 123,
"compute_cost_cents": 123,
"volume_gb": 123,
"volume_cost_cents": 123,
"total_cost_cents": 123
}
]
}
},
"private_cloud": {
"total_cost_cents": 123,
"sections": {},
"instances": {}
}
},
"meta": {
"currency": "<string>",
"period": 123,
"available_periods": [
{
"from": "<string>",
"to": "<string>"
}
],
"last_updated_at": "<string>"
}
}{
"message": ""
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Get usage
Get billing and usage data for the authenticated organization.
Money is in US cents (*_cents).
Time is exact. Each *_hours field is decimal hours, and the matching *_seconds field is the same time in whole seconds: compute_hours and compute_seconds, usage_time_hours and usage_time_seconds, and hours and seconds on managed queue compute_sizes. Compute hours are the wall-clock hours of all replicas or workers added together, not vCPU-hours. On environment usage items, active_replicas counts the replicas that ran as long as the busiest one, comparing their hours rounded to one decimal. On private cloud items, the primary and standby always count, and read replicas count when their usage, rounded to one decimal, matches the primary’s.
Stored data (database storage and backups, bucket storage_gb) is in GB-months: storage averaged over the whole billing period. During the current period, Laravel MySQL storage and backups and AWS RDS storage assume the amount stored now stays until the period ends, so they are a projection for the full period. Laravel Serverless Postgres storage and bucket storage_gb count only the period so far, so they grow until the period ends. Transferred data (log drain volume_gb, data transfer) is the total for the period so far. For databases, buckets, log drains and bandwidth, GB is 10^9 bytes.
Database metrics name their unit in unit_label: hours for Laravel MySQL compute, CU-hours for Laravel Serverless Postgres compute, and GB for storage, backups and data transfer. seconds is set when the unit is hours, and is null otherwise.
Private cloud items and their replicas give their exact quantity in usage_amount, in the unit named by the item’s usage_unit: GB, hours, NLCU-hours, M (millions of requests), or connection/connections. When the unit is hours, usage_seconds is the same time in whole seconds.
These fields are rounded: operations_millions to 2 decimals (use operations_count), usage_value for display (use usage_amount), and summary.bandwidth.usage_percentage and summary.alert.remaining_percentage to whole percentages. usage_percentage is capped at 100 and remaining_percentage at 0.
Deprecated: cpu_hours. Use compute_hours on environment usage items, and usage_amount on private cloud replicas.
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": [
{
"name": "<string>",
"identifier": "<string>",
"type": "<string>",
"storage": {
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{}
]
}
]
},
"compute": {
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{}
]
}
]
},
"data_transfer": {
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{}
]
}
]
},
"backup": {
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{
"cents": 123,
"units": 123,
"unit_label": "<string>",
"seconds": 123,
"info": "<string>",
"label": "<string>",
"breakdown": [
{}
]
}
]
},
"total_cents": 123,
"deleted": true
}
],
"caches": [
{
"name": "<string>",
"identifier": "<string>",
"type": "<string>",
"storage": "<string>",
"compute_cents": 123,
"compute_hours": 123,
"compute_seconds": 123,
"total_cents": 123,
"deleted": true
}
],
"buckets": [
{
"name": "<string>",
"identifier": "<string>",
"class_a_requests_cents": 123,
"class_a_requests_count": 123,
"class_b_requests_cents": 123,
"class_b_requests_count": 123,
"storage_cents": 123,
"storage_gb": 123,
"total_cents": 123,
"deleted": true
}
],
"websockets": [
{
"name": "<string>",
"identifier": "<string>",
"max_connections": 123,
"usage_time_cents": 123,
"usage_time_hours": 123,
"usage_time_seconds": 123,
"total_cents": 123,
"deleted": true
}
]
},
"addons": {
"total_cost_cents": 123,
"items": [
{
"name": "<string>",
"total_cents": 123
}
]
},
"application_totals": {
"total_cost_cents": 123,
"application_count": 123,
"applications": [
{
"identifier": "<string>",
"total_cost_cents": 123,
"environment_count": 123,
"deleted": true
}
]
},
"environment_usage": {
"total_cost_cents": 123,
"items": [
{
"identifier": "<string>",
"type": "<string>",
"compute_profile": "<string>",
"compute_description": "<string>",
"active_replicas": 123,
"total_replicas": 123,
"compute_hours": 123,
"cpu_hours": 123,
"compute_seconds": 123,
"total_cents": 123
}
],
"managed_queues": {
"total_cost_cents": 123,
"has_compute": true,
"has_operations": true,
"queues": [
{
"name": "<string>",
"compute_hours": 123,
"compute_seconds": 123,
"compute_cost_cents": 123,
"compute_sizes": [
{
"profile": "<string>",
"description": "<string>",
"hours": 123,
"seconds": 123,
"cost_cents": 123
}
],
"operations_count": 123,
"operations_millions": 123,
"operations_cost_cents": 123,
"total_cost_cents": 123
}
]
},
"log_drains": {
"total_cost_cents": 123,
"drains": [
{
"name": "<string>",
"type": "<string>",
"type_label": "<string>",
"compute_hours": 123,
"compute_seconds": 123,
"compute_cost_cents": 123,
"volume_gb": 123,
"volume_cost_cents": 123,
"total_cost_cents": 123
}
]
}
},
"private_cloud": {
"total_cost_cents": 123,
"sections": {},
"instances": {}
}
},
"meta": {
"currency": "<string>",
"period": 123,
"available_periods": [
{
"from": "<string>",
"to": "<string>"
}
],
"last_updated_at": "<string>"
}
}{
"message": ""
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}organization_usage.viewQuery Parameters
Was this page helpful?

