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