获取指定模型详情
curl --request GET \
--url https://geekai.co/api/v1/models/{model} \
--header 'Authorization: Bearer <token>'import requests
url = "https://geekai.co/api/v1/models/{model}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://geekai.co/api/v1/models/{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://geekai.co/api/v1/models/{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: 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://geekai.co/api/v1/models/{model}"
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://geekai.co/api/v1/models/{model}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.co/api/v1/models/{model}")
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{
"id": "gpt-4",
"name": "GPT-4",
"desc": "GPT-4是一个大规模语言模型...",
"created": 1689127080,
"owned_by": "openai",
"context": 8192,
"platform": {
"name": "openai",
"alias": "OpenAI",
"website": "https://openai.com"
},
"is_free": true,
"price": {
"currency": "CNY",
"unit": "mtokens",
"input": 0.03,
"output": 0.06,
"cache_read": 0,
"cache_write": 0,
"audio_input": 0,
"audio_output": 0,
"draw_image": {
"price": 0,
"unit": "nums"
},
"web_search": {
"price": 0,
"unit": "times"
},
"discounts": [
{
"channel": "ha-speed",
"discount": 0.8,
"desc": "高可用线路高速通道"
}
]
}
}{
"code": "unauthorized",
"message": "Invalid API key or token"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}模型列表
模型明细
GET
/
models
/
{model}
获取指定模型详情
curl --request GET \
--url https://geekai.co/api/v1/models/{model} \
--header 'Authorization: Bearer <token>'import requests
url = "https://geekai.co/api/v1/models/{model}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://geekai.co/api/v1/models/{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://geekai.co/api/v1/models/{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: 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://geekai.co/api/v1/models/{model}"
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://geekai.co/api/v1/models/{model}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://geekai.co/api/v1/models/{model}")
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{
"id": "gpt-4",
"name": "GPT-4",
"desc": "GPT-4是一个大规模语言模型...",
"created": 1689127080,
"owned_by": "openai",
"context": 8192,
"platform": {
"name": "openai",
"alias": "OpenAI",
"website": "https://openai.com"
},
"is_free": true,
"price": {
"currency": "CNY",
"unit": "mtokens",
"input": 0.03,
"output": 0.06,
"cache_read": 0,
"cache_write": 0,
"audio_input": 0,
"audio_output": 0,
"draw_image": {
"price": 0,
"unit": "nums"
},
"web_search": {
"price": 0,
"unit": "times"
},
"discounts": [
{
"channel": "ha-speed",
"discount": 0.8,
"desc": "高可用线路高速通道"
}
]
}
}{
"code": "unauthorized",
"message": "Invalid API key or token"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}{
"code": "invalid_request",
"message": "请求参数不合法"
}请求/响应参数明细
授权
bearerAuthapiKeyAuth
API认证token
路径参数
模型ID
响应
成功响应
模型唯一标识
示例:
"gpt-4"
模型显示名称
示例:
"GPT-4"
模型类型
可用选项:
chat, image, audio, video, embedding 模型详细描述
示例:
"GPT-4是一个大规模语言模型..."
模型创建时间戳
示例:
1689127080
模型所有者/提供商
示例:
"openai"
上下文窗口大小
示例:
8192
平台信息
Show child attributes
Show child attributes
是否免费
示例:
true
价格信息
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I
