检索模型
curl --request GET \
--url https://api.ppio.com/openai/v1/models/{model} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.ppio.com/openai/v1/models/{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.ppio.com/openai/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://api.ppio.com/openai/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: <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.ppio.com/openai/v1/models/{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.ppio.com/openai/v1/models/{model}")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/openai/v1/models/{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{
"id": "<string>",
"created": 123,
"object": "<string>",
"owned_by": "<string>",
"permission": null,
"root": "<string>",
"parent": "<string>",
"title": "<string>",
"display_name": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"model_type": "<string>",
"status": 123,
"context_size": 123,
"max_output_tokens": 123,
"min_output_tokens": 123,
"features": [
"<string>"
],
"endpoints": [
"<string>"
],
"input_modalities": [
"<string>"
],
"output_modalities": [
"<string>"
],
"input_token_price_per_m": 123,
"output_token_price_per_m": 123,
"pricing": {
"prompt": {},
"completion": {},
"input_cache_read": {},
"input_cache_write": {},
"input_cache_write_1h": {},
"multimodal_input": [
{}
],
"multimodal_output": [
{}
]
},
"is_tiered_billing": true,
"tiered_billing_configs": [
{
"min_tokens": 123,
"max_tokens": 123,
"output_min_tokens": 123,
"output_max_tokens": 123,
"pricing": {}
}
]
}大语言
检索模型
了解 PPIO 模型检索接口,查阅指定模型信息的读取方式,为应用核对模型标识和准备服务调用提供参考。
GET
/
openai
/
v1
/
models
/
{model}
检索模型
curl --request GET \
--url https://api.ppio.com/openai/v1/models/{model} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.ppio.com/openai/v1/models/{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.ppio.com/openai/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://api.ppio.com/openai/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: <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.ppio.com/openai/v1/models/{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.ppio.com/openai/v1/models/{model}")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/openai/v1/models/{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{
"id": "<string>",
"created": 123,
"object": "<string>",
"owned_by": "<string>",
"permission": null,
"root": "<string>",
"parent": "<string>",
"title": "<string>",
"display_name": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"model_type": "<string>",
"status": 123,
"context_size": 123,
"max_output_tokens": 123,
"min_output_tokens": 123,
"features": [
"<string>"
],
"endpoints": [
"<string>"
],
"input_modalities": [
"<string>"
],
"output_modalities": [
"<string>"
],
"input_token_price_per_m": 123,
"output_token_price_per_m": 123,
"pricing": {
"prompt": {},
"completion": {},
"input_cache_read": {},
"input_cache_write": {},
"input_cache_write_1h": {},
"multimodal_input": [
{}
],
"multimodal_output": [
{}
]
},
"is_tiered_billing": true,
"tiered_billing_configs": [
{
"min_tokens": 123,
"max_tokens": 123,
"output_min_tokens": 123,
"output_max_tokens": 123,
"pricing": {}
}
]
}检索模型实例,并提供相关模型的基本信息。
该 Endpoint 与 OpenAI API 兼容。
请求头
路径参数
响应参数
输入价格(每百万 Token)。单位为万分之一元,例如 60000 表示 6 元。已包含当前生效的折扣,与 pricing.prompt.price_per_m 相同;不返回 pricing 的模型该值为 0。
输出价格(每百万 Token)。单位为万分之一元。已包含当前生效的折扣,与 pricing.completion.price_per_m 相同;不返回 pricing 的模型该值为 0。
按计费项拆分的价格,每个计费项同时给出目录价和折后价。没有价格的模型不返回该字段。每个计费项都包含以下 4 个字段:
- origin_price_per_m:目录价(每百万 Token),单位为万分之一元。
- price_per_m:当前生效折扣后的价格(每百万 Token),单位为万分之一元。没有折扣时与 origin_price_per_m 相同。
- origin_price_per_m_decimal:目录价(每百万 Token),单位为元,以字符串返回。
- price_per_m_decimal:折后价(每百万 Token),单位为元,以字符串返回。
隐藏 properties
隐藏 properties
按输入模态拆分的输入价格,仅按模态分别计价的模型返回。每项包含 modals(模态列表,例如 [“image”])、input_token_base_price(目录价)和 input_token_discount_price(折后价),价格为每百万 Token,单位为万分之一元。
阶梯计费配置,仅 is_tiered_billing 为 true 时返回。单次请求按输入 Token 数落入的区间计费;少数模型同时按输出 Token 数划分区间。阶梯计费模型的实际价格以各区间的 pricing 为准,顶层 input_token_price_per_m 和 output_token_price_per_m 与最高输入区间一致。
最后修改于 2026年11月2日