跳转到内容
EN

列出模型

GET/google/v1beta/models● 支持

Gemini API 官方文档 ↗

请求参数

  • pageSizeinteger可选

    query: The maximum number of Models to return (per page). If unspecified, 50 models will be returned per page. This method returns at most 1000 models per page, even if you pass a larger page_size.

    支持分页;0、负数和非数字返回 400,超过上限会截断。

  • pageTokenstring可选

    query: A page token, received from a previous ListModels call. Provide the page_token returned by one request as an argument to the next request to retrieve the next page. When paginating, all other parameters provided to ListModels must match the call that provided the page token.

    已验证生效。

返回

200

向量嵌入模型会以 embedContent 作为其唯一受支持的方法列出。当模型目录 暂时不可用时,generateContent 的行为保持不变:显式要求图像输出 (responseModalities 含 IMAGE)的请求仍走图像通道;未显式声明的旧式图像请求 在该窗口内会按文本对话处理——降级期间每个响应都带 X-Praxis-Route-Degraded: model-catalog-unavailable 头以示区别。

错误按 Gemini API 格式返回,参见 错误码

请求示例

curl
curl https://api.deepraxis.com/google/v1beta/models \
  -H "x-goog-api-key: $PRAXIS_API_KEY"
Python
from google import genai
from google.genai import types

client = genai.Client(
    api_key="$PRAXIS_API_KEY",
    http_options=types.HttpOptions(base_url="https://api.deepraxis.com/google"),
)

for model in client.models.list():
    print(model.name)
TypeScript
import { GoogleGenAI } from "@google/genai";

const ai = new GoogleGenAI({
  apiKey: "$PRAXIS_API_KEY",
  httpOptions: { baseUrl: "https://api.deepraxis.com/google" },
});

const pager = await ai.models.list();
for await (const model of pager) console.log(model.name);

响应示例 200

{
  "models": [
    {
      "name": "models/official-test/deepseek-v4-flash",
      "baseModelId": "official-test/deepseek-v4-flash",
      "version": "001",
      "displayName": "DeepSeek V4 Flash · 官方 Test",
      "description": "Develop 测试专用,仅绑定 DeepSeek 官方;用于 SDK 与 thinking 兼容对照,非 Computrix 修复声明。",
      "inputTokenLimit": 1000000,
      "outputTokenLimit": 384000,
      "supportedGenerationMethods": [
        "generateContent",
        "streamGenerateContent",
        "countTokens"
      ],
      "thinking": true
    },
    {
      "name": "models/official-test/deepseek-v4-pro",
      "baseModelId": "official-test/deepseek-v4-pro",
      "version": "001",
      "displayName": "DeepSeek V4 Pro · 官方 Test",
      "description": "Develop 测试专用,仅绑定 DeepSeek 官方;用于 SDK 与 thinking 兼容对照,非 Computrix 修复声明。",
      "inputTokenLimit": 1000000,
      "outputTokenLimit": 384000,
      "supportedGenerationMethods": [
        "generateContent",
        "streamGenerateContent",
        "countTokens"
      ],
      "thinking": true
    },
    {
      "name": "models/bdd-spec-model-z8t1b2",
      "baseModelId": "bdd-spec-model-z8t1b2",
      "version": "001",
      "displayName": "BDD Spec Model",
      "inputTokenLimit": 222000,
      "outputTokenLimit": 4096,
      "supportedGenerationMethods": [
        "generateContent",
        "streamGenerateContent",
        "countTokens"
      ]
    }
  ]
}

响应

HTTP 200

Successful response

application/json

名称 类型 说明
models array<object> The returned Models.
models[].baseModelId string Required. The name of the base model, pass this to the generation request. Examples: * gemini-1.5-flash
models[].description string A short description of the model.
models[].displayName string The human-readable name of the model. E.g. "Gemini 1.5 Flash". The name can be up to 128 characters long and can consist of any UTF-8 characters.
models[].inputTokenLimit integer Maximum number of input tokens allowed for this model.
models[].maxTemperature number The maximum temperature this model can use.
models[].name string Required. The resource name of the Model. Refer to Model variants for all allowed values. Format: models/{model} with a {model} naming convention of: * "{base_model_id}-{version}" Examples: * models/gemini-1.5-flash-001
models[].outputTokenLimit integer Maximum number of output tokens available for this model.
models[].supportedGenerationMethods array<string> The model's supported generation methods. The corresponding API method names are defined as Pascal case strings, such as generateMessage and generateContent.
models[].temperature number Controls the randomness of the output. Values can range over [0.0,max_temperature], inclusive. A higher value will produce responses that are more varied, while a value closer to 0.0 will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.
models[].thinking boolean Whether the model supports thinking.
models[].topK integer For Top-k sampling. Top-k sampling considers the set of top_k most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and top_k isn't allowed as a generation parameter.
models[].topP number For Nucleus sampling. Nucleus sampling considers the smallest set of tokens whose probability sum is at least top_p. This value specifies default to be used by the backend while making the call to the model.
models[].version string Required. The version number of the model. This represents the major version (1.0 or 1.5)
nextPageToken string A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no more pages.