Skip to Content

Gemini Models API

通过 Gemini 原生协议查询 OfoxAI 平台上可用的模型。响应格式遵循 Google GenAI API 规范(namedisplayNameinputTokenLimit 等 camelCase 字段)。

Models API 是公开接口,无需 API Key 即可调用。此端点返回所有可通过 Gemini 协议调用的模型,不仅限于 Google 系列。

列出所有模型

GET https://api.ofox.ai/gemini/v1beta/models

请求示例

Terminal
curl https://api.ofox.ai/gemini/v1beta/models

响应格式

{ "models": [ { "name": "models/google/gemini-3-flash-preview", "version": "001", "displayName": "Google: Gemini 3 Flash Preview", "description": "High speed, high value thinking model designed for agentic workflows...", "inputTokenLimit": 1048576, "outputTokenLimit": 65536, "supportedGenerationMethods": [ "generateContent", "countTokens" ], "ownedBy": "google", "canonicalSlug": "gemini-3-flash-preview", "contextLength": 1048576, "architecture": { "modality": "text+image+audio+file->text", "input_modalities": ["text", "image", "audio", "file"], "output_modalities": ["text"], "tokenizer": "gemini", "instruct_type": null }, "pricing": { "prompt": "0.0000005", "completion": "0.000003", "audio": "0.000001", "input_cache_read": "0.00000005", "input_cache_write": "0.000001", "web_search": "0.014" }, "topProvider": { "context_length": 1048576, "max_completion_tokens": 65536, "is_moderated": false }, "supportedParameters": [ "temperature", "top_p", "max_tokens", "stop", "tools", "tool_choice", "response_format", "reasoning" ], "expirationDate": null } ] }

与 OpenAI 协议的字段差异

字段OpenAI 协议Gemini 协议
列表键名datamodels
模型标识idname(带 models/ 前缀)
名称namedisplayName
上下文长度context_lengthinputTokenLimit + contextLength
最大输出top_provider.max_completion_tokensoutputTokenLimit
命名风格snake_casecamelCase

按供应商过滤模型

GET https://api.ofox.ai/gemini/v1beta/models/{provider}

路径参数

参数类型说明
providerstring供应商标识,如 googleanthropicopenai

请求示例

Terminal
# 仅列出 Google 系列模型 curl https://api.ofox.ai/gemini/v1beta/models/google

响应格式

返回格式与列出所有模型一致,models 数组仅包含指定供应商的模型。

获取模型详情

GET https://api.ofox.ai/gemini/v1beta/models/{provider}/{model_id}

路径参数

参数类型说明
providerstring供应商标识,如 google
model_idstring模型名称,如 gemini-3-flash-preview

请求示例

Terminal
curl https://api.ofox.ai/gemini/v1beta/models/google/gemini-3-flash-preview

响应格式

返回单个 Model 对象,结构与列表接口中的对象一致。

Last updated on