Volumes
List volumes
Returns one row per volume in the namespace, each with its tags, head version, and version counts.
GET
/
v1
/
volumes
cURL
curl --request GET \
--url https://api.baseten.co/v1/volumes \
--header "Authorization: Bearer $BASETEN_API_KEY"
import requests
import os
API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
url = "https://api.baseten.co/v1/volumes"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.request(
"GET",
url,
headers=headers,
params={'cursor': None, 'namespace': None}
)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.baseten.co/v1/volumes', 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.baseten.co/v1/volumes",
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://api.baseten.co/v1/volumes"
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://api.baseten.co/v1/volumes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baseten.co/v1/volumes")
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{
"items": [
{
"namespace": "<string>",
"name": "<string>",
"version_ref": "<string>",
"sequence": 123,
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"head": {
"digest": "<string>",
"total_size_bytes": 123,
"created_at": "2023-11-07T05:31:56Z"
},
"tags": [
{
"name": "<string>",
"digest": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
],
"tag_count": 123,
"versions_alive": 123,
"versions_tombstoned": 123,
"versions_untagged": 123,
"versions_expiring": 123,
"versions_earliest_expires_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"has_more": true,
"cursor": "<string>"
}
}Authorizations
Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.
Query Parameters
Opaque cursor returned by a previous page. Omit to fetch the first page.
Maximum number of volumes to return.
Required range:
1 <= x <= 1000Namespace to list volumes in. Required, because the volume service has no cross-namespace inventory.
Was this page helpful?
⌘I
cURL
curl --request GET \
--url https://api.baseten.co/v1/volumes \
--header "Authorization: Bearer $BASETEN_API_KEY"
import requests
import os
API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
url = "https://api.baseten.co/v1/volumes"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.request(
"GET",
url,
headers=headers,
params={'cursor': None, 'namespace': None}
)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.baseten.co/v1/volumes', 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.baseten.co/v1/volumes",
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://api.baseten.co/v1/volumes"
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://api.baseten.co/v1/volumes")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baseten.co/v1/volumes")
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{
"items": [
{
"namespace": "<string>",
"name": "<string>",
"version_ref": "<string>",
"sequence": 123,
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"head": {
"digest": "<string>",
"total_size_bytes": 123,
"created_at": "2023-11-07T05:31:56Z"
},
"tags": [
{
"name": "<string>",
"digest": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}
],
"tag_count": 123,
"versions_alive": 123,
"versions_tombstoned": 123,
"versions_untagged": 123,
"versions_expiring": 123,
"versions_earliest_expires_at": "2023-11-07T05:31:56Z"
}
],
"pagination": {
"has_more": true,
"cursor": "<string>"
}
}