Obter lista de modelos
curl --request GET \
--url https://api.highwayapi.ai/openai/v1/models \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.highwayapi.ai/openai/v1/models"
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.highwayapi.ai/openai/v1/models', 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.highwayapi.ai/openai/v1/models",
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.highwayapi.ai/openai/v1/models"
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.highwayapi.ai/openai/v1/models")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/openai/v1/models")
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{
"data": [
{
"id": "<string>",
"created": 123,
"object": "<string>",
"input_token_price_per_m": 123,
"output_token_price_per_m": 123,
"title": "<string>",
"description": "<string>",
"context_size": 123
}
]
}Modelos de linguagem
Obter lista de modelos
GET
/
openai
/
v1
/
models
Obter lista de modelos
curl --request GET \
--url https://api.highwayapi.ai/openai/v1/models \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.highwayapi.ai/openai/v1/models"
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.highwayapi.ai/openai/v1/models', 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.highwayapi.ai/openai/v1/models",
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.highwayapi.ai/openai/v1/models"
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.highwayapi.ai/openai/v1/models")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/openai/v1/models")
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{
"data": [
{
"id": "<string>",
"created": 123,
"object": "<string>",
"input_token_price_per_m": 123,
"output_token_price_per_m": 123,
"title": "<string>",
"description": "<string>",
"context_size": 123
}
]
}Obtém a lista de modelos atualmente disponíveis para a LLM API e fornece as informações básicas de cada modelo. Este endpoint é compatível com a OpenAI API.
Cabeçalhos da requisição
string
obrigatório
Valores enumerados:
application/jsonstring
obrigatório
Formato de autenticação Bearer: Bearer {{API Key}}.
Informações da resposta
object[]
obrigatório
Array de objetos de modelo contendo as seguintes propriedades:
Ocultar Propriedades do objeto de modelo
Ocultar Propriedades do objeto de modelo
string
obrigatório
Identificador do modelo, que pode ser referenciado nos API Endpoints.
integer
obrigatório
Timestamp Unix de criação do modelo (em segundos).
string
obrigatório
Tipo de objeto, sempre “model”.
integer
obrigatório
Preço por milhão de tokens de entrada.
integer
obrigatório
Preço por milhão de tokens de saída.
string
obrigatório
Título do modelo.
string
obrigatório
Descrição do modelo.
integer
obrigatório
Tamanho máximo de contexto do modelo.
⌘I