获取可用模型列表
curl --request GET \
--url https://kaienapi.com/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://kaienapi.com/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://kaienapi.com/v1/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://kaienapi.com/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))
}{
"object": "list",
"data": [
{
"id": "qwen-plus",
"object": "model",
"created": 1715367049,
"owned_by": "system"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}获取可用模型列表
返回当前 Key 可访问的模型列表。
何时调用
- 接入前确认当前 Key 可选的模型。
- 为前端模型选择器提供数据。
- 请求返回模型不存在时,核对模型名是否完整。
返回里的 id 就是后续文本、图片、视频或音频请求中的模型名。
GET
/
v1
/
models
获取可用模型列表
curl --request GET \
--url https://kaienapi.com/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://kaienapi.com/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://kaienapi.com/v1/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://kaienapi.com/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))
}{
"object": "list",
"data": [
{
"id": "qwen-plus",
"object": "model",
"created": 1715367049,
"owned_by": "system"
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}⌘I