It looks like you may prefer a different language. Switch anytime.

Text Google

Gemini API

透過 RunAPI 使用 Gemini API,包含 model skill、統一驗證與按用量計費。

runapi.ai
# Base URL
https://runapi.ai

# Endpoints
POST /v1/chat/completions
POST /v1/responses
POST /v1/messages
POST /v1beta/models/{model}:generateContent
POST /v1beta/models/{model}:streamGenerateContent
curl https://runapi.ai/v1/chat/completions \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-3.7-flash",
  "messages": [
    {
      "role": "user",
      "content": "Analyze this codebase and suggest three performance improvements with before/after examples."
    }
  ]
}'
from openai import OpenAI

client = OpenAI(
    base_url="https://runapi.ai/v1",
    api_key="your-runapi-key"
)

response = client.chat.completions.create(
    model="gemini-3.7-flash",
    messages=[{"role": "user", "content": "Analyze this codebase and suggest three performance improvements with before/after examples."}]
)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://runapi.ai/v1",
  apiKey: "your-runapi-key"
});

const response = await client.chat.completions.create({
  model: "gemini-3.7-flash",
  messages: [{ role: "user", content: "Analyze this codebase and suggest three performance improvements with before/after examples." }]
});
https://runapi.ai 5 endpoints
OVERVIEW

關於 Gemini

Gemini is Google's multimodal large language model family supporting text, image, audio, and code understanding. Available in Flash and Pro variants, it handles tasks from quick summarization to deep reasoning and complex coding.

供應商
Google
模式
Text

Gemini API 端點

EndpointProtocol
POST /v1/chat/completionsOpenAI compatible
POST /v1/responsesOpenAI Responses
POST /v1/messagesAnthropic compatible
POST /v1beta/models/{model}:generateContentGemini generateContent
POST /v1beta/models/{model}:streamGenerateContentGemini streamGenerateContent

比較所有 API 變體

變體 計費 定價
gemini-2.5-flash 1K tokens Input $0.30 / 1M tokens | Output $2.50 / 1M tokens 查看 →
gemini-2.5-pro 1K tokens Input $1.25-$2.50 / 1M tokens | Output $10.00-$15.00 / 1M tokens 查看 →
gemini-3-flash-preview 1K tokens Input $0.50 / 1M tokens | Output $3.00 / 1M tokens · Input $0.30 / 1M tokens | Output $1.80 / 1M tokens 查看 →
gemini-3.1-pro-preview 1K tokens Input $1.00-$2.00 / 1M tokens | Output $7.00-$10.50 / 1M tokens 查看 →
gemini-3.5-flash 1K tokens Input $1.50 / 1M tokens | Output $9.00 / 1M tokens · Input $0.90 / 1M tokens | Output $5.40 / 1M tokens 查看 →
gemini-3.6-flash 1K tokens Input $1.50 / 1M tokens | Output $7.50 / 1M tokens · Input $0.90 / 1M tokens | Output $4.50 / 1M tokens 查看 →
gemini-3.7-flash 1K tokens Input $0.45 / 1M tokens | Output $2.25 / 1M tokens 查看 →
PRICING

Gemini 定價

Endpoint 解析度 時長 價格
chat_completion Input $0.30 / 1M tokens | Output $2.50 / 1M tokens

以下為 gemini-2.5-flash 的定價。其他變體保留各自的 endpoint 定價。

Agent 整合

透過 Agent 執行 Gemini

運作方式

開始使用 Gemini

  1. 選擇模型

    挑選符合輸出類型、品質門檻與延遲目標的模型與變體。

  2. 設定

    設定 RunAPI key,並在 coding workspace 安裝 model skill。

  3. 開發

    使用 skill 指引,在你的 app 內加入模型功能。

  4. 接收

    透過 task ID 查詢、在支援時串流,或處理 webhook callback。

CONTEXT

Gemini API 是甚麼?

Gemini is Google's flagship multimodal LLM, available in Flash (fast) and Pro (frontier reasoning) variants. Through RunAPI, all Gemini models share the same API shape and billing.

供應商
Google
查看全部 →
模式
Text
瀏覽模型 →

為何透過 RunAPI 使用 Gemini API

一個驗證,對應所有 provider

一組 RunAPI key 即可解鎖整個 catalog。無需分開帳戶,亦無需為每個整合輪換密鑰。

統一定價與計費

按次以 USD 收費,每月結算。失敗的生成不會收費。

內含 schema 的 skill

型別化 schema 與 setup 備註打包在 model skill 內,讓實作從正確契約開始。

Gemini 常見問題

What is the context window size for Gemini?

Up to 1 million tokens across all variants. This handles entire codebases, long documents, and multi-turn conversations without truncation.

What input modalities does Gemini accept?

Text, images, audio, and video. You can pass multimodal inputs in a single request for cross-modal reasoning.

What is Google Search grounding?

Gemini can ground responses in real-time Google Search results, reducing hallucination for factual and time-sensitive queries.

How do Flash and Pro compare?

Flash is optimized for speed and cost — ideal for high-volume tasks. Pro delivers deeper reasoning and is better for complex multi-step analysis.

Does Gemini support function calling?

Yes — Gemini supports structured function calling with typed JSON schemas, making it suitable for agentic workflows and tool use.

我應該先用邊個版本?

先選最平而且符合你質素要求的版本。大多數團隊會先用快速版本,之後再升級到 pro 用於正式生產。

相似模型

如果你鍾意 Gemini API,可以試吓呢些

開始用 Gemini API 開發。