获取模型列表
curl --request GET \
--url https://api.omniall.ai/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omniall.ai/v1/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omniall.ai/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.omniall.ai/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: 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.omniall.ai/v1/models"
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.omniall.ai/v1/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omniall.ai/v1/models")
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{
"success": true,
"object": "list",
"data": [
{
"id": "gpt-4o-mini",
"object": "model",
"created": 1626777600,
"owned_by": "openai",
"supported_endpoint_types": [
"openai"
]
},
{
"id": "kling-2.5",
"object": "model",
"created": 1626777600,
"owned_by": "custom",
"supported_endpoint_types": [
"openai-video"
]
}
]
}
模型
获取模型列表
返回当前已鉴权 API Key / 用户分组可用的模型列表。
响应形态由请求头 / 查询参数决定(与网关路由一致):
- 默认(Bearer / OpenAI 风格):OpenAI 列表格式(
object+data) x-api-key+anthropic-version:Anthropic 风格列表x-goog-api-key或key查询参数:Gemini 风格列表
请将每个模型的 id 用作 chat、图像、视频等接口的 model 字段。
另见模型广场:https://omniall.ai/pricing
GET
/
v1
/
models
获取模型列表
curl --request GET \
--url https://api.omniall.ai/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omniall.ai/v1/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omniall.ai/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.omniall.ai/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: 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.omniall.ai/v1/models"
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.omniall.ai/v1/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omniall.ai/v1/models")
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{
"success": true,
"object": "list",
"data": [
{
"id": "gpt-4o-mini",
"object": "model",
"created": 1626777600,
"owned_by": "openai",
"supported_endpoint_types": [
"openai"
]
},
{
"id": "kling-2.5",
"object": "model",
"created": 1626777600,
"owned_by": "custom",
"supported_endpoint_types": [
"openai-video"
]
}
]
}
授权
使用来自 https://omniall.ai/dashboard 的 Authorization: Bearer sk-...
请求头
Anthropic 兼容 API Key。与 anthropic-version 同时出现时,
响应使用 Anthropic 列表格式。网关也接受该值作为令牌
(等同于 Authorization: Bearer ...)。
示例:
"sk-xxxxxxxx"
Anthropic API 版本请求头。与 x-api-key 一起使用可请求 Anthropic 响应格式。
示例:
"2023-06-01"
Gemini 兼容 API Key。存在时响应使用 Gemini 列表格式。
示例:
"sk-xxxxxxxx"
查询参数
备用 Gemini 兼容 API Key(查询参数),效果同 x-goog-api-key。
示例:
"sk-xxxxxxxx"