Skip to main content
POST
/
compute
/
clusters
/
storage
/
volumes
Together AI SDK (v2)
from together import Together
client = Together()

volume = client.beta.clusters.storage.create(
  volume_name="my-shared-volume",
  size_tib=2,
  region="us-west-2"
)
import Together from "together-ai";
const client = new Together();

const volume = await client.beta.clusters.storage.create({
volume_name: "my-shared-volume",
size_tib: 2,
region: "us-west-2"
});
import Together from "together-ai";
const client = new Together();

const volume = await client.beta.clusters.storage.create({
volume_name: "my-shared-volume",
size_tib: 2,
region: "us-west-2"
});
tg beta clusters storage create \
--volume-name my-shared-volume \
--size-tib 2 \
--region us-west-2
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.together.ai/v1/compute/clusters/storage/volumes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'volume_name' => '<string>',
'size_tib' => 123,
'region' => '<string>',
'is_lifecycle_independent' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.together.ai/v1/compute/clusters/storage/volumes"

payload := strings.NewReader("{\n \"volume_name\": \"<string>\",\n \"size_tib\": 123,\n \"region\": \"<string>\",\n \"is_lifecycle_independent\": true\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.together.ai/v1/compute/clusters/storage/volumes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"volume_name\": \"<string>\",\n \"size_tib\": 123,\n \"region\": \"<string>\",\n \"is_lifecycle_independent\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.together.ai/v1/compute/clusters/storage/volumes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"volume_name\": \"<string>\",\n \"size_tib\": 123,\n \"region\": \"<string>\",\n \"is_lifecycle_independent\": true\n}"

response = http.request(request)
puts response.read_body
{
  "volume_id": "<string>",
  "volume_name": "<string>",
  "size_tib": 123
}

Authorizations

Authorization
string
header
default:default
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
volume_name
string
required

User provided name of the volume.

size_tib
integer
required

Volume size in whole tebibytes (TiB).

region
string
required

Region name. Usable regions can be found from clusters.list_regions()

is_lifecycle_independent
boolean

When true, the shared volume is not deleted when the cluster is decommissioned.

Response

200 - application/json

OK

volume_id
string
required

ID of the volume.

volume_name
string
required

User provided name of the volume.

size_tib
integer
required

Size of the volume in TiB.

status
enum<string>
required

Current status of the shared volume.

Available options:
scheduled,
available,
bound,
provisioning,
deleting,
failed,
access_revoked,
unknown