Get Model
curl --request GET \
--url https://api.novita.ai/v3/model \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.novita.ai/v3/model"
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'}
};
fetch('https://api.novita.ai/v3/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.novita.ai/v3/model",
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: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.novita.ai/v3/model"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.novita.ai/v3/model")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v3/model")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"models": [
{
"id": 123,
"name": "<string>",
"hash_sha256": "<string>",
"sd_name": "<string>",
"type": {
"name": "<string>",
"display_name": "<string>"
},
"categories": [
"<string>"
],
"status": 123,
"download_url": "<string>",
"tags": [
"<string>"
],
"cover_url": "<string>",
"source": "<string>",
"base_model": "<string>",
"base_model_type": "<string>",
"download_url_ttl": 123,
"sd_name_in_api": "<string>"
}
],
"pagination": {
"next_cursor": "<string>"
}
}Model
Get Model
GET
/
v3
/
model
Get Model
curl --request GET \
--url https://api.novita.ai/v3/model \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.novita.ai/v3/model"
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'}
};
fetch('https://api.novita.ai/v3/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.novita.ai/v3/model",
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: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.novita.ai/v3/model"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.novita.ai/v3/model")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v3/model")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"models": [
{
"id": 123,
"name": "<string>",
"hash_sha256": "<string>",
"sd_name": "<string>",
"type": {
"name": "<string>",
"display_name": "<string>"
},
"categories": [
"<string>"
],
"status": 123,
"download_url": "<string>",
"tags": [
"<string>"
],
"cover_url": "<string>",
"source": "<string>",
"base_model": "<string>",
"base_model_type": "<string>",
"download_url_ttl": 123,
"sd_name_in_api": "<string>"
}
],
"pagination": {
"next_cursor": "<string>"
}
}This API endpoint is designed to retrieve information on both public and private models. It allows users to access details such as model specifications, status, and usage guidelines, ensuring comprehensive insights into the available modeling resources.
response
Request Headers
string
required
Enum:
application/jsonstring
required
Bearer authentication format, for example: Bearer {{API Key}}.
Query Parameters
string
Model types:
public or private. If not set, the interface will query all types of models.string
Source of the model.
Enum:
Enum:
civitai, training, uploadingstring
Specifies the types of models to include in the query.
Enum:
Enum:
checkpoint, lora, vae, controlnet, upscaler, textualinversionboolean
Whether the model is SDXL or not. Setting this parameter to
true includes only SDXL models in the query results, which are typically large-scale, high-performance models designed for extensive data processing tasks. Conversely, setting it to false excludes these models from the results. If left unspecified, the filter will not discriminate based on the SDXL classification, including all model types in the search results.string
Searches the content of sd_name, name, and tags.
boolean
If set to true, it will filter out the checkpoints used for inpainting. The default is false.
string
Number of models to query per request, range (0, 100].
string
pagination.cursor is used to specify which record to start returning from. If it is empty, it means to get it from the beginning. Generally, the content of the next page is obtained by passing in the next_cursor field value from the response packet.
Response
object[]
Show properties
Show properties
integer
ID of the model.
string
Model name.
string
Hash of the model file.
string
Model file name.
string[]
Model categories.
integer
Model status: 0 for unavailable, 1 for available.
string
Model download URL.
string[]
Model tags, such as photorealistic, anatomical, base model, CGI, realistic, semi-realistic.
string
Model cover image URL.
string
The source of the model, such as civitai, training, uploading.
string
Base model of the model, such as SD 1.5 or SDXL 1.0.
string
Base model type of the model, such as Inpainting or Standard.
integer
The expiration time of the download URL in seconds, default is 1 day.
string
The name users can add in the interface.
Example
requestcurl --location 'https://api.novita.ai/v3/model?filter.visibility=public&pagination.limit=2&pagination.cursor=c_0' \
--header 'Authorization: Bearer {{API Key}}'
{
"models": [
{
"id": 114600,
"name": "V4.0-inpainting (VAE)",
"hash_sha256": "1A805277C8",
"sd_name": "realisticVisionV40_v40VAE-inpainting_81543.safetensors",
"type": {
"name": "checkpoint",
"display_name": "Checkpoint"
},
"categories": [],
"status": 1,
"tags": [
"photorealistic",
"anatomical",
"base model",
"cgi",
"realistic",
"semi-realistic"
],
"cover_url": "https://next-app-static.s3.amazonaws.com/images-prod/xG1nkqKTMzGDvpLrqFT7WA/f291a219-4a86-45ab-96eb-c53446b3e4df/width=450/1495044.jpeg",
"base_model": "SD 1.5",
"base_model_type": "Inpainting",
"download_url_ttl": 2592000,
"sd_name_in_api": "realisticVisionV40_v40VAE-inpainting_81543.safetensors",
"is_sdxl": false
},
{
"id": 55199,
"name": "beta2",
"hash_sha256": "BA43B0EFEE",
"sd_name": "GoodHands-beta2_39807.safetensors",
"type": {
"name": "locon",
"display_name": "locon"
},
"categories": [],
"status": 1,
"tags": ["photorealistic", "concept", "hands"],
"cover_url": "https://next-app-static.s3.amazonaws.com/images-prod/xG1nkqKTMzGDvpLrqFT7WA/031a378c-3d66-45da-5d67-966c47cd4800/width=450/599083.jpeg",
"base_model": "SD 1.5",
"base_model_type": "Standard",
"download_url_ttl": 2592000,
"sd_name_in_api": "GoodHands-beta2_39807",
"is_sdxl": false
}
],
"pagination": {
"next_cursor": "c_WzgwNDY2NiwiNTUxOTkiXQ=="
}
}
Last modified on December 25, 2024