List models
curl --request GET \
--url https://api.example.com/api/modelimport requests
url = "https://api.example.com/api/model"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/model', 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.example.com/api/model",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/model"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/model")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/model")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"location": {
"directory": "<string>",
"project": {
"id": "<string>",
"directory": "<string>"
},
"workspaceID": "<string>"
},
"data": [
{
"id": "<string>",
"modelID": "<string>",
"providerID": "<string>",
"name": "<string>",
"capabilities": {
"tools": true,
"input": [
"<string>"
],
"output": [
"<string>"
]
},
"variants": [
{
"id": "<string>",
"settings": {},
"headers": {},
"body": {}
}
],
"time": {
"released": 123
},
"cost": [
{
"input": 123,
"output": 123,
"cache": {
"read": 123,
"write": 123
},
"tier": {
"type": "context",
"size": 123
}
}
],
"enabled": true,
"limit": {
"context": 123,
"output": 123,
"input": 123
},
"family": "<string>",
"package": "<string>",
"settings": {},
"headers": {},
"body": {}
}
]
}{
"_tag": "InvalidRequestError",
"message": "<string>",
"kind": "<string>",
"field": "<string>"
}{
"_tag": "UnauthorizedError",
"message": "<string>"
}{
"_tag": "ServiceUnavailableError",
"message": "<string>",
"service": "<string>"
}model
List models
Retrieve available models ordered by release date.
GET
/
api
/
model
List models
curl --request GET \
--url https://api.example.com/api/modelimport requests
url = "https://api.example.com/api/model"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/model', 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.example.com/api/model",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.example.com/api/model"
req, _ := http.NewRequest("GET", url, nil)
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.example.com/api/model")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/model")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"location": {
"directory": "<string>",
"project": {
"id": "<string>",
"directory": "<string>"
},
"workspaceID": "<string>"
},
"data": [
{
"id": "<string>",
"modelID": "<string>",
"providerID": "<string>",
"name": "<string>",
"capabilities": {
"tools": true,
"input": [
"<string>"
],
"output": [
"<string>"
]
},
"variants": [
{
"id": "<string>",
"settings": {},
"headers": {},
"body": {}
}
],
"time": {
"released": 123
},
"cost": [
{
"input": 123,
"output": 123,
"cache": {
"read": 123,
"write": 123
},
"tier": {
"type": "context",
"size": 123
}
}
],
"enabled": true,
"limit": {
"context": 123,
"output": 123,
"input": 123
},
"family": "<string>",
"package": "<string>",
"settings": {},
"headers": {},
"body": {}
}
]
}{
"_tag": "InvalidRequestError",
"message": "<string>",
"kind": "<string>",
"field": "<string>"
}{
"_tag": "UnauthorizedError",
"message": "<string>"
}{
"_tag": "ServiceUnavailableError",
"message": "<string>",
"service": "<string>"
}⌘I