Instance types
Instance type prices
GET
/
v1
/
instance_type_prices
cURL
curl --request GET \
--url https://api.baseten.co/v1/instance_type_prices \
--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/instance_type_prices"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.request(
"GET",
url,
headers=headers,
json={}
)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.baseten.co/v1/instance_type_prices', 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/instance_type_prices",
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/instance_type_prices"
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/instance_type_prices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baseten.co/v1/instance_type_prices")
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{
"instance_types": [
{
"instance_type": {
"id": "<string>",
"name": "<string>",
"memory_limit_mib": 123,
"millicpu_limit": 123,
"gpu_count": 123,
"gpu_type": "<string>",
"gpu_memory_limit_mib": 123
},
"price": 123
}
]
}Was this page helpful?
Previous
All Model APIsLists Model APIs visible to the caller. By default returns the full catalog; pass `added_only=true` to restrict to Model APIs the workspace has added.
Next
⌘I
cURL
curl --request GET \
--url https://api.baseten.co/v1/instance_type_prices \
--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/instance_type_prices"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.request(
"GET",
url,
headers=headers,
json={}
)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.baseten.co/v1/instance_type_prices', 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/instance_type_prices",
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/instance_type_prices"
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/instance_type_prices")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.baseten.co/v1/instance_type_prices")
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{
"instance_types": [
{
"instance_type": {
"id": "<string>",
"name": "<string>",
"memory_limit_mib": 123,
"millicpu_limit": 123,
"gpu_count": 123,
"gpu_type": "<string>",
"gpu_memory_limit_mib": 123
},
"price": 123
}
]
}