Model resources
Estimate on-demand model resource cost
Estimates a model resource’s on-demand hourly price without creating it.
POST
/
v1
/
rl
/
model-resources
/
estimate-cost
Together AI SDK (Python)
from together import Together
client = Together()
estimate = client.post_training.model_resources.estimate_cost(
base_model="Qwen/Qwen3.5-9B",
lora_enabled=True,
compute_config={"gpu_type": "B200-SXM", "num_generator_replicas": 1},
)
print(estimate)curl --request POST \
--url https://api.together.ai/v1/rl/model-resources/estimate-cost \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"base_model": "Qwen/Qwen3.5-4B",
"base_weights_ref": "together://ml_A1b2C3d4E5f6G7h8I9j0K",
"compute_config": {
"num_generator_replicas": 2,
"gpu_type": "B200-SXM",
"num_trainer_replicas": 0
},
"lora_enabled": true,
"optimizer_config": {
"adam": {},
"muon": {
"scaling_strategy": "MUON_SCALING_STRATEGY_ORIGINAL"
}
},
"inactive_timeout": 3600
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
base_model: 'Qwen/Qwen3.5-4B',
base_weights_ref: 'together://ml_A1b2C3d4E5f6G7h8I9j0K',
compute_config: {num_generator_replicas: 2, gpu_type: 'B200-SXM', num_trainer_replicas: 0},
lora_enabled: true,
optimizer_config: {adam: {}, muon: {scaling_strategy: 'MUON_SCALING_STRATEGY_ORIGINAL'}},
inactive_timeout: 3600
})
};
fetch('https://api.together.ai/v1/rl/model-resources/estimate-cost', 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.together.ai/v1/rl/model-resources/estimate-cost",
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([
'base_model' => 'Qwen/Qwen3.5-4B',
'base_weights_ref' => 'together://ml_A1b2C3d4E5f6G7h8I9j0K',
'compute_config' => [
'num_generator_replicas' => 2,
'gpu_type' => 'B200-SXM',
'num_trainer_replicas' => 0
],
'lora_enabled' => true,
'optimizer_config' => [
'adam' => [
],
'muon' => [
'scaling_strategy' => 'MUON_SCALING_STRATEGY_ORIGINAL'
]
],
'inactive_timeout' => 3600
]),
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/rl/model-resources/estimate-cost"
payload := strings.NewReader("{\n \"base_model\": \"Qwen/Qwen3.5-4B\",\n \"base_weights_ref\": \"together://ml_A1b2C3d4E5f6G7h8I9j0K\",\n \"compute_config\": {\n \"num_generator_replicas\": 2,\n \"gpu_type\": \"B200-SXM\",\n \"num_trainer_replicas\": 0\n },\n \"lora_enabled\": true,\n \"optimizer_config\": {\n \"adam\": {},\n \"muon\": {\n \"scaling_strategy\": \"MUON_SCALING_STRATEGY_ORIGINAL\"\n }\n },\n \"inactive_timeout\": 3600\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/rl/model-resources/estimate-cost")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"base_model\": \"Qwen/Qwen3.5-4B\",\n \"base_weights_ref\": \"together://ml_A1b2C3d4E5f6G7h8I9j0K\",\n \"compute_config\": {\n \"num_generator_replicas\": 2,\n \"gpu_type\": \"B200-SXM\",\n \"num_trainer_replicas\": 0\n },\n \"lora_enabled\": true,\n \"optimizer_config\": {\n \"adam\": {},\n \"muon\": {\n \"scaling_strategy\": \"MUON_SCALING_STRATEGY_ORIGINAL\"\n }\n },\n \"inactive_timeout\": 3600\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/rl/model-resources/estimate-cost")
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 \"base_model\": \"Qwen/Qwen3.5-4B\",\n \"base_weights_ref\": \"together://ml_A1b2C3d4E5f6G7h8I9j0K\",\n \"compute_config\": {\n \"num_generator_replicas\": 2,\n \"gpu_type\": \"B200-SXM\",\n \"num_trainer_replicas\": 0\n },\n \"lora_enabled\": true,\n \"optimizer_config\": {\n \"adam\": {},\n \"muon\": {\n \"scaling_strategy\": \"MUON_SCALING_STRATEGY_ORIGINAL\"\n }\n },\n \"inactive_timeout\": 3600\n}"
response = http.request(request)
puts response.read_body{
"price_per_hour": 56,
"currency": "USD"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}Authorizations
Body
application/json
Request to provision a standalone model resource
Seconds without activity after which the resource stops and its sessions expire, counted from when it becomes ready and from its last activity. Every operation on any of its sessions restarts the count, and an extend expiry call can keep it up longer.
Required range:
300 <= x <= 86400Example:
3600
Was this page helpful?
⌘I
Together AI SDK (Python)
from together import Together
client = Together()
estimate = client.post_training.model_resources.estimate_cost(
base_model="Qwen/Qwen3.5-9B",
lora_enabled=True,
compute_config={"gpu_type": "B200-SXM", "num_generator_replicas": 1},
)
print(estimate)curl --request POST \
--url https://api.together.ai/v1/rl/model-resources/estimate-cost \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"base_model": "Qwen/Qwen3.5-4B",
"base_weights_ref": "together://ml_A1b2C3d4E5f6G7h8I9j0K",
"compute_config": {
"num_generator_replicas": 2,
"gpu_type": "B200-SXM",
"num_trainer_replicas": 0
},
"lora_enabled": true,
"optimizer_config": {
"adam": {},
"muon": {
"scaling_strategy": "MUON_SCALING_STRATEGY_ORIGINAL"
}
},
"inactive_timeout": 3600
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
base_model: 'Qwen/Qwen3.5-4B',
base_weights_ref: 'together://ml_A1b2C3d4E5f6G7h8I9j0K',
compute_config: {num_generator_replicas: 2, gpu_type: 'B200-SXM', num_trainer_replicas: 0},
lora_enabled: true,
optimizer_config: {adam: {}, muon: {scaling_strategy: 'MUON_SCALING_STRATEGY_ORIGINAL'}},
inactive_timeout: 3600
})
};
fetch('https://api.together.ai/v1/rl/model-resources/estimate-cost', 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.together.ai/v1/rl/model-resources/estimate-cost",
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([
'base_model' => 'Qwen/Qwen3.5-4B',
'base_weights_ref' => 'together://ml_A1b2C3d4E5f6G7h8I9j0K',
'compute_config' => [
'num_generator_replicas' => 2,
'gpu_type' => 'B200-SXM',
'num_trainer_replicas' => 0
],
'lora_enabled' => true,
'optimizer_config' => [
'adam' => [
],
'muon' => [
'scaling_strategy' => 'MUON_SCALING_STRATEGY_ORIGINAL'
]
],
'inactive_timeout' => 3600
]),
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/rl/model-resources/estimate-cost"
payload := strings.NewReader("{\n \"base_model\": \"Qwen/Qwen3.5-4B\",\n \"base_weights_ref\": \"together://ml_A1b2C3d4E5f6G7h8I9j0K\",\n \"compute_config\": {\n \"num_generator_replicas\": 2,\n \"gpu_type\": \"B200-SXM\",\n \"num_trainer_replicas\": 0\n },\n \"lora_enabled\": true,\n \"optimizer_config\": {\n \"adam\": {},\n \"muon\": {\n \"scaling_strategy\": \"MUON_SCALING_STRATEGY_ORIGINAL\"\n }\n },\n \"inactive_timeout\": 3600\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/rl/model-resources/estimate-cost")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"base_model\": \"Qwen/Qwen3.5-4B\",\n \"base_weights_ref\": \"together://ml_A1b2C3d4E5f6G7h8I9j0K\",\n \"compute_config\": {\n \"num_generator_replicas\": 2,\n \"gpu_type\": \"B200-SXM\",\n \"num_trainer_replicas\": 0\n },\n \"lora_enabled\": true,\n \"optimizer_config\": {\n \"adam\": {},\n \"muon\": {\n \"scaling_strategy\": \"MUON_SCALING_STRATEGY_ORIGINAL\"\n }\n },\n \"inactive_timeout\": 3600\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.together.ai/v1/rl/model-resources/estimate-cost")
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 \"base_model\": \"Qwen/Qwen3.5-4B\",\n \"base_weights_ref\": \"together://ml_A1b2C3d4E5f6G7h8I9j0K\",\n \"compute_config\": {\n \"num_generator_replicas\": 2,\n \"gpu_type\": \"B200-SXM\",\n \"num_trainer_replicas\": 0\n },\n \"lora_enabled\": true,\n \"optimizer_config\": {\n \"adam\": {},\n \"muon\": {\n \"scaling_strategy\": \"MUON_SCALING_STRATEGY_ORIGINAL\"\n }\n },\n \"inactive_timeout\": 3600\n}"
response = http.request(request)
puts response.read_body{
"price_per_hour": 56,
"currency": "USD"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": null,
"code": null
}
}