Gemini Models API
通过 Gemini 原生协议查询 OfoxAI 平台上可用的模型。响应格式遵循 Google GenAI API 规范(name、displayName、inputTokenLimit 等 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 协议 |
|---|---|---|
| 列表键名 | data | models |
| 模型标识 | id | name(带 models/ 前缀) |
| 名称 | name | displayName |
| 上下文长度 | context_length | inputTokenLimit + contextLength |
| 最大输出 | top_provider.max_completion_tokens | outputTokenLimit |
| 命名风格 | snake_case | camelCase |
按供应商过滤模型
GET https://api.ofox.ai/gemini/v1beta/models/{provider}路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
provider | string | 供应商标识,如 google、anthropic、openai |
请求示例
Terminal
# 仅列出 Google 系列模型
curl https://api.ofox.ai/gemini/v1beta/models/google响应格式
返回格式与列出所有模型一致,models 数组仅包含指定供应商的模型。
获取模型详情
GET https://api.ofox.ai/gemini/v1beta/models/{provider}/{model_id}路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
provider | string | 供应商标识,如 google |
model_id | string | 模型名称,如 gemini-3-flash-preview |
请求示例
Terminal
curl https://api.ofox.ai/gemini/v1beta/models/google/gemini-3-flash-preview响应格式
返回单个 Model 对象,结构与列表接口中的对象一致。
Last updated on