Typescript (SDK)
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.objectStorage.getStorageBucketMetrics({
bucketId: "<id>",
});
console.log(result);
}
run();package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.ObjectStorage.GetStorageBucketMetrics(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}curl --request GET \
--url https://api.latitude.sh/storage/buckets/{bucket_id}/metrics \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/storage/buckets/{bucket_id}/metrics"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/storage/buckets/{bucket_id}/metrics', 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.latitude.sh/storage/buckets/{bucket_id}/metrics",
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: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/storage/buckets/{bucket_id}/metrics")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/storage/buckets/{bucket_id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "bkt_6VE1Wd37dXnZJ",
"type": "object_storage_metrics",
"attributes": {
"period": {
"start": "2026-05-01T00:00:00Z",
"end": "2026-06-01T00:00:00Z"
},
"storage": {
"consumed": 4096,
"unit": "GB"
},
"estimated_cost": {
"amount": 250,
"currency": "BRL"
}
}
}
}{
"errors": [
{
"code": "STORAGE_NOT_ENABLED",
"title": "Object Storage not enabled"
}
]
}{
"errors": [
{
"code": "NOT_FOUND",
"message": "Object storage not found"
}
]
}Object Storage
Retrieve bucket metrics
Retrieves usage metrics for a specific object storage bucket, including storage consumption and estimated cost for the current billing period.
GET
/
storage
/
buckets
/
{bucket_id}
/
metrics
Typescript (SDK)
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.objectStorage.getStorageBucketMetrics({
bucketId: "<id>",
});
console.log(result);
}
run();package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.ObjectStorage.GetStorageBucketMetrics(ctx, "<id>")
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}curl --request GET \
--url https://api.latitude.sh/storage/buckets/{bucket_id}/metrics \
--header 'Authorization: <api-key>'import requests
url = "https://api.latitude.sh/storage/buckets/{bucket_id}/metrics"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/storage/buckets/{bucket_id}/metrics', 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.latitude.sh/storage/buckets/{bucket_id}/metrics",
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: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.latitude.sh/storage/buckets/{bucket_id}/metrics")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/storage/buckets/{bucket_id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "bkt_6VE1Wd37dXnZJ",
"type": "object_storage_metrics",
"attributes": {
"period": {
"start": "2026-05-01T00:00:00Z",
"end": "2026-06-01T00:00:00Z"
},
"storage": {
"consumed": 4096,
"unit": "GB"
},
"estimated_cost": {
"amount": 250,
"currency": "BRL"
}
}
}
}{
"errors": [
{
"code": "STORAGE_NOT_ENABLED",
"title": "Object Storage not enabled"
}
]
}{
"errors": [
{
"code": "NOT_FOUND",
"message": "Object storage not found"
}
]
}Was this page helpful?
⌘I