跳转到主要内容
GET
/
v1
/
models
列出模型
curl --request GET \
  --url https://openp.ai/v1/models
import requests

url = "https://openp.ai/v1/models"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://openp.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://openp.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",
]);

$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://openp.ai/v1/models"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://openp.ai/v1/models")
.asString();
require 'uri'
require 'net/http'

url = URI("https://openp.ai/v1/models")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
返回当前 API Key 有权限调用的所有模型。

请求

curl https://openp.ai/v1/models \
  -H "Authorization: Bearer $OPENPAI_API_KEY"
无查询参数。

响应

{
  "object": "list",
  "data": [
    {
      "id": "gpt-5.5",
      "object": "model",
      "created": 1715750400,
      "owned_by": "openai"
    },
    {
      "id": "gpt-5.4-mini",
      "object": "model",
      "created": 1715750400,
      "owned_by": "openai"
    },
    {
      "id": "claude-opus-4-8",
      "object": "model",
      "created": 1715750400,
      "owned_by": "anthropic"
    }
  ]
}

获取单个模型

curl https://openp.ai/v1/models/gpt-5.5 \
  -H "Authorization: Bearer $OPENPAI_API_KEY"
返回:
{
  "id": "gpt-5.5",
  "object": "model",
  "created": 1715750400,
  "owned_by": "openai"
}

范围

  • 列表受 令牌的模型范围设置 限制 —— 如果创建令牌时设置了白名单,这里只返回白名单内的模型。
  • 用户分组 影响:仅返回当前分组可访问的模型。

用途

  • 客户端启动时拉取一次,缓存到本地,作为下拉菜单的可选列表。
  • 在自建网关 / 中转代理中转发该接口,供下游用户查询。