List Models
curl --request GET \
--url https://api.example.com/api/models/listimport requests
url = "https://api.example.com/api/models/list"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/models/list', 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/models/list",
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/models/list"
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/models/list")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/models/list")
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{
"items": [
{
"id": "<string>",
"user_id": "<string>",
"base_model_id": "<string>",
"name": "<string>",
"params": {},
"meta": {
"profile_image_url": "<string>",
"description": "<string>",
"capabilities": {}
},
"access_grants": [
{}
],
"is_active": true,
"write_access": true,
"user": {
"id": "<string>",
"name": "<string>",
"email": "<string>"
},
"created_at": 123,
"updated_at": 123
}
],
"total": 123
}Models
List Models
Retrieve a paginated list of models with filtering and sorting options
GET
/
api
/
models
/
list
List Models
curl --request GET \
--url https://api.example.com/api/models/listimport requests
url = "https://api.example.com/api/models/list"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/models/list', 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/models/list",
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/models/list"
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/models/list")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/models/list")
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{
"items": [
{
"id": "<string>",
"user_id": "<string>",
"base_model_id": "<string>",
"name": "<string>",
"params": {},
"meta": {
"profile_image_url": "<string>",
"description": "<string>",
"capabilities": {}
},
"access_grants": [
{}
],
"is_active": true,
"write_access": true,
"user": {
"id": "<string>",
"name": "<string>",
"email": "<string>"
},
"created_at": 123,
"updated_at": 123
}
],
"total": 123
}Query Parameters
string
Search query to filter models by name, base_model_id, or user information
string
Filter models by ownership:
created- Only models created by the current usershared- Only models shared with the current user
string
Filter models by tag name
string
Field to sort by:
name- Sort by model namecreated_at- Sort by creation dateupdated_at- Sort by last update date
string
Sort direction:
asc- Ascending orderdesc- Descending order (default)
integer
default:1
Page number for pagination (30 items per page)
Response
array
Array of model objects with access information
string
The model’s unique identifier used in API calls
string
ID of the user who created the model
string
Optional pointer to the actual model used when proxying requests
string
Human-readable display name of the model
object
JSON object containing model parameters
object
array
Array of access grant objects defining permissions
boolean
Whether the model is currently active
boolean
Whether the current user has write access to this model
object
integer
Unix timestamp of when the model was created
integer
Unix timestamp of when the model was last updated
integer
Total number of models matching the filter criteria
Example Request
curl -X GET "https://api.example.com/api/models/list?page=1&order_by=created_at&direction=desc" \
-H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
"items": [
{
"id": "gpt-4-custom",
"user_id": "user123",
"base_model_id": "gpt-4",
"name": "Custom GPT-4",
"params": {
"temperature": 0.7,
"max_tokens": 2000
},
"meta": {
"profile_image_url": "/static/favicon.png",
"description": "A customized GPT-4 model for specific tasks",
"capabilities": {
"vision": true,
"function_calling": true
}
},
"access_grants": [],
"is_active": true,
"write_access": true,
"user": {
"id": "user123",
"name": "John Doe",
"email": "john@example.com"
},
"created_at": 1704067200,
"updated_at": 1704153600
}
],
"total": 1
}