Skip to main content
GET
/
v1
/
model_apis
/
{model_api_name}
cURL
curl --request GET \
--url https://api.baseten.co/v1/model_apis/{model_api_name} \
--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/model_apis/{model_api_name}"

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/model_apis/{model_api_name}', 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/model_apis/{model_api_name}",
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/model_apis/{model_api_name}"

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/model_apis/{model_api_name}")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.baseten.co/v1/model_apis/{model_api_name}")

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
{
  "name": "<string>",
  "display_name": "<string>",
  "description": "<string>",
  "release_date": "2023-12-25",
  "invoke_url": "<string>",
  "context_length": 123,
  "cost_per_million_input_tokens": "0.13",
  "cost_per_million_output_tokens": "0.50",
  "rate_limits": [
    {
      "threshold": 1
    }
  ],
  "model_family": "META",
  "org_details": {
    "added_at": "2023-11-07T05:31:56Z",
    "last_used_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.

Path Parameters

model_api_name
string
required

Response

200 - application/json

A Model API catalog row, optionally enriched with workspace-specific state.

name
string
required

Identifier of the Model API. Stable, URL-safe slug used as the public identifier.

Example:

"llama-3-3-70b-instruct"

display_name
string
required

Human-readable name of the Model API.

Example:

"Llama 3.3 70B Instruct"

description
string
required

Description of the Model API.

release_date
string<date>
required

Date the Model API was made available.

invoke_url
string
required

Base URL for invoking the Model API. OpenAI-shaped routes (e.g. /v1/chat/completions) live underneath this host.

Example:

"https://inference.baseten.co"

context_length
integer
required

The model's context window length, in tokens.

Example:

8192

cost_per_million_input_tokens
required

Cost per million input tokens, in dollars.

Example:

"0.13"

cost_per_million_output_tokens
required

Cost per million output tokens, in dollars.

Example:

"0.50"

rate_limits
RateLimitV1 · object[]
required

Rate limits in effect for the workspace. Workspace-specific overrides are returned when the workspace has added this Model API and configured them; otherwise the catalog default rate limits are returned.

model_family
string | null

Family the underlying model belongs to.

Example:

"META"

org_details
ModelAPIOrgDetailsV1 · object | null

Workspace-specific state. Null when the workspace has not added this Model API.