模型

Google: Gemini 2.5 Pro (batch)

Markdown · JSON

Google: Gemini 2.5 Pro (batch)

Gemini 2.5 Pro 是 Google 用於複雜程式碼、數學、STEM 及長上下文分析的穩定版 thinking 模型。它接收文字、圖像、音訊、影片及 PDF,回傳文字,支援工具與結構化輸出。動態推理預算支援 128–32,768 token,無法完全關閉。

關於模型

此說明介紹模型的能力。Ailoot 可用的輸入、輸出與選項,依所選方法列於下方。

Gemini 2.5 Pro 是 Google 用於進階程式開發、數學、STEM 及長上下文分析的穩定版 thinking 設定。它能理解文字、音訊、圖像、影片及整個程式碼儲存庫,其 Gemini API 設定也接受 PDF 輸入。輸出為文字,包含程式碼、書面分析或結構化紀錄。實用任務應提供證據,要求可檢查的結果,例如附解說的解答、程式碼庫發現或多文件比較。

程式開發應提供相關檔案、觀察到的行為,以及重要變更或問題。長上下文可協助模型關聯模組,而非僅依單一孤立片段推理。程式碼路徑調查可要求從輸入表單追蹤某個識別碼,經過處理至儲存,找出契約改變的位置並提出聚焦修正。請保留限制並要求支持參照。修訂建議需要與實際程式碼,以及透過連接工具完成的任何驗證比較。

數學或科學分析應說明問題、假設、單位及所需答案形式。請提供計算依賴的資料或圖形。要求有依據的結果,以及讓結果可評估的檢查,例如邊界案例或與原始值比較。模型推理能力不會消除題目敘述的歧義。應讓未知量或無依據假設保持可見,而非用方便的數值取代。

文件記載的預設為動態 thinking。Gemini 2.5 GenerateContent 指南對 Pro 支援 128 至 32,768 token 的明確推理預算,或以 -1 使用自適應 thinking。此版本無法完全關閉 thinking。這些控制不同於 Flash 的零預算選項,也不同於 Gemini 3 的 thinking-level 設定。Thinking 預算指引推理,而非保證確切內部 token 數量;回應上限也需為最終成果留下空間。

多模態文件工作應指出支持答案的頁面、圖表、圖像區域或錄影事件。實用整合任務可要求列出多份來源文件中相互競爭的主張、支持段落,以及與某項決策相關的差異。請要求模型區分明述事實與推論。影片或音訊應定義結果是描述、轉錄稿、摘要或比較。在此設定中,圖像與聲音是文字結果的證據。

此確切 API 頁面記載函式呼叫、程式碼執行、檔案搜尋、搜尋 grounding、Maps grounding、URL context 及結構化輸出。請定義函式用途及參數欄位,在後續回合保留真實結果。受結構描述約束的紀錄應指定必要欄位及缺漏資訊的表示方式。原生架構為多模態稀疏混合專家 Transformer;此模型設計本身不會提供外部工具執行,也不會在回傳文字或程式碼之外提供完成的應用程式。

原生模型資訊卡列出 1M 輸入上下文及 64K 文字輸出;API 表指定 1,048,576 輸入 token 及 65,536 輸出 token。指令、來源內容及保留歷史皆需納入輸入準備。最大回應額度包含推理 token,因此過小上限可能中斷最終答案。文件記載快取及批次處理,以及 Flex、Priority 選項。準備獨立長上下文任務時,應保留各來源識別碼及所需最終形式。

穩定版識別碼與共用 Pro 模型資訊卡另行討論的 Experimental 及 Preview 版本不同。不能只因共享 Pro 名稱,就將那些版本專屬結果歸於此設定。資訊卡指出可能的幻覺,以及因果理解、複雜演繹及反事實推理限制,知識截止時間為 2025 年 1 月。最新資訊重要時請提供最新證據,並檢查來源參照、計算及修改建議。實用輸出是任務所要求且有依據的文字或程式碼成果。

Ailoot Ultra · 批次處理(Batch) POST /v1/batches google/gemini-2.5-pro:batch

google/gemini-2.5-pro:batch

Google /google/gemini-2.5-pro:batch

入門

Gemini 2.5 Pro 是 Google 用於複雜程式碼、數學、STEM 及長上下文分析的穩定版 thinking 模型。它接收文字、圖像、音訊、影片及 PDF,回傳文字,支援工具與結構化輸出。動態推理預算支援 128–32,768 token,無法完全關閉。

接受的輸入
文字
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot Ultra · 批次處理(Batch) POST /v1/batches
輸入
text
輸出
text
輸出格式
內嵌的 results[].response.body JSON
欄位類型要求值與限制預設值
欄位endpoint類型string要求必填值與限制
/v1/chat/completions
預設值—
欄位model類型string要求必填值與限制
google/gemini-2.5-pro:batch
預設值—
欄位requests類型batch_item[]要求必填值與限制
項目數下限: 1
預設值—
欄位requests[].custom_id類型string要求必填值與限制預設值—
欄位requests[].body.messages類型message[]要求必填值與限制預設值—
欄位completion_window類型string要求選填值與限制
24h
預設值—
欄位provider類型object|null要求選填值與限制預設值—
欄位requests[].body.model類型string要求選填值與限制
google/gemini-2.5-pro:batch, google/gemini-2.5-pro
預設值—
欄位provider.only類型string[]要求選填值與限制
google-vertex/global
預設值—
欄位provider.allow_fallbacks類型boolean|null要求選填值與限制
false, null
預設值—
方法參數與生命週期
參數規格
參數content_type規格application/json
參數required規格endpoint, model, requests
參數material_types規格text
參數representation規格內嵌的 requests[];每個項目皆含 custom_id 與 body
參數request_endpoint_profile規格/v1/chat/completions
參數file_material規格呼叫端可在本機將實際的 UTF-8 JSONL 讀入 requests[]。此流程不使用上傳用途、input_file_id 或檔案參照。若缺少客戶素材或素材為空,應在 POST 前停止準備。
參數serialization_order規格endpoint, model, provider(如有提供), completion_window(如有提供), requests 放在最後
參數optional_controls規格provider.only, provider.allow_fallbacks, completion_window
參數schema_scope規格依文件規定的內嵌 Batch 封裝格式提供文字 Chat Completions 請求主體。

生命週期: asynchronous

GET /v1/batches/{operation_id} · 原始建立回應中實際回傳的 response.id;使用相同使用者/金鑰/群組

方案

費率資訊不會增加請求選項。支援的參數列於所選方法中。

快速模式
未指定 選取快速模式時
flex 模式
未指定 選取 flex 模式時
最高推理強度
未指定 最高推理強度採用 default 調整值時
顯式快取計價
未啟用 請求顯式快取時

Ailoot 費率

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定詞元基本費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.00125 / 1K Token
輸出 · 輸出 Token $0.01 / 1K Token
輸入 · 讀取快取 $0.00025 / 1K Token
輸入 · 寫入快取 — / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於200,000費用
輸入 · 輸入 Token $0.00125 / 1K Token
輸出 · 輸出 Token $0.01 / 1K Token
輸入 · 讀取快取 $0.00025 / 1K Token
輸入 · 寫入快取 — / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定請求長度級距 2費率表—上下文 Token 數大於200,000上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0025 / 1K Token
輸出 · 輸出 Token $0.015 / 1K Token
輸入 · 讀取快取 $0.0005 / 1K Token
輸入 · 寫入快取 — / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

請求範例

Ailoot Ultra · 批次處理(Batch)

curl · 保留的測試資料Python HTTP · 客戶實際的 JSONLPython · 儲存每個已完成的結果
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
python3 - <<'PY_REQUEST'
import json
from pathlib import Path
body=json.loads('{"endpoint":"/v1/chat/completions","model":"google/gemini-2.5-pro:batch","requests":[{"custom_id":"req-0001","body":{"messages":[{"role":"user","content":"Hello!"}],"max_tokens":16}}]}')
Path("batch-request.json").write_text(json.dumps(body,ensure_ascii=False),encoding="utf-8")
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/batches \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @batch-request.json -D batch-response-headers.txt -o batch-create-response.json
import json, os
from pathlib import Path
from urllib.request import Request, urlopen

def prepare_requests(customer_path):
    path = Path(customer_path)
    if not path.is_file(): raise ValueError("Customer JSONL file is missing")
    items = [json.loads(line) for line in path.read_text(encoding="utf-8").splitlines() if line.strip()]
    if not items: raise ValueError("Customer JSONL contains no requests")
    ids = set()
    for item in items:
        if set(item) != {"custom_id", "body"}: raise ValueError("Each item needs custom_id and body")
        cid = item["custom_id"]
        if not isinstance(cid, str) or not cid.strip() or cid in ids: raise ValueError("custom_id must be nonempty and unique")
        ids.add(cid)
        if not isinstance(item["body"], dict) or not item["body"].get("messages"): raise ValueError("Supply actual text messages")
        supplied_model = item["body"].get("model")
        if supplied_model is not None and supplied_model not in ['google/gemini-2.5-pro:batch', 'google/gemini-2.5-pro']: raise ValueError("body.model must be an exact documented caller or wire ID")
    return {"endpoint":"/v1/chat/completions", "model":"google/gemini-2.5-pro:batch", "requests":items}

if __name__ == "__main__":
    material = os.environ.get("AILOOT_BATCH_REQUESTS_JSONL", "")
    if not material: raise SystemExit("Set AILOOT_BATCH_REQUESTS_JSONL to your actual customer file")
    body = prepare_requests(material)
    key = os.environ.get("AILOOT_API_KEY", "")
    if not key: raise SystemExit("Set AILOOT_API_KEY")
    request = Request("https://api.ailoot.ai/v1/batches", data=json.dumps(body, ensure_ascii=False).encode("utf-8"), headers={"Authorization":"Bearer " + key, "Content-Type":"application/json"}, method="POST")
    with urlopen(request) as response:
        raw = response.read()
        Path("batch-create-response.json").write_bytes(raw)
        print(raw.decode("utf-8"))
import json
from pathlib import Path
raw = Path("batch-status-response.json").read_bytes()
response = json.loads(raw)
if response.get("status") != "completed":
    raise SystemExit("Keep the original operation; read its status without resubmitting")
results = response.get("results")
if not isinstance(results, list) or not results:
    raise SystemExit("Preserve the original response; completed results are missing")
Path("batch-results.jsonl").write_text("".join(json.dumps(item, ensure_ascii=False) + "\n" for item in results), encoding="utf-8")
# Preserve batch-status-response.json with aggregate usage and every result/error.

接收並儲存結果

Ailoot Ultra · 批次處理(Batch)

內嵌的 results[].response.body JSON

  • GET /v1/batches/{operation_id}
查看工作狀態
curl · 原始作業狀態
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
BATCH_OPERATION_ID="$(python3 - <<'PY_ID'
import json
from pathlib import Path
from urllib.parse import quote
response = json.loads(Path("batch-create-response.json").read_text(encoding="utf-8"))
operation = response.get("id")
if not isinstance(operation, str) or not operation: raise SystemExit("No actual original operation ID; preserve the response and do not resubmit")
print(quote(operation, safe=""))
PY_ID
)"
curl --fail-with-body --silent --show-error "https://api.ailoot.ai/v1/batches/$BATCH_OPERATION_ID" \
  -H "Authorization: Bearer $AILOOT_API_KEY" -o batch-status-response.json
保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留完整的原始狀態 JSON、每個結果/custom_id,以及完整的回應或錯誤主體。將已完成的 results[] 儲存為 JSONL,不得篩除任何項目。

需要檢查原始回應時

保留原始作業 ID。503 result_pending_check 回應帶有 X-Should-Retry:false;請勿重新提交狀態不明的原始批次。

回應欄位
欄位類型
欄位results[].custom_id類型string
欄位results[].response.body.choices[].message.content類型string|null
欄位results[].error類型object|null
欄位usage類型object|null
欄位id類型string
欄位model類型string
欄位endpoint類型string
欄位status類型string
欄位request_counts類型object
欄位results[].id類型string
欄位results[].response.status_code類型integer
欄位results[].response.request_id類型string
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件文件規定的內嵌封裝格式無效、索引鍵重複、項目識別有誤,或與已設定的模型能力衝突。下一步再次提交前,請先修正指出的欄位。
回應401 · authentication_error條件API 金鑰無效。下一步使用已獲授權的 Ailoot 金鑰。
回應403 · permission_error條件批次處理群組無法使用。下一步檢查金鑰/群組的使用權限。
回應422 · invalid_request_error條件批次處理採用餘額計費;透過訂閱建立批次的請求會遭拒絕。下一步使用已獲授權、以餘額計費的群組。
回應422 · price_unavailable條件無法為批次輸入估價。下一步保留回應;使用文件規定的該 API 家族輸入格式。
回應402 · billing_error條件批次處理的預留額度無法取得。下一步提交新請求前,請先解決請求受理問題。
回應503 · price_unavailable條件批次處理方法的價格/原生費率無法取得。下一步保留回應;請勿替換價格。
回應503 · api_error條件指定的供應商路由無法使用。下一步保留回應,以供修復路由。
回應503 · result_pending_check條件原始結果需要檢查;X-Should-Retry:false。下一步保留原始 operation_id/id 並讀取其狀態;請勿重複原始 POST。
回應404 · not_found條件查詢批次狀態所需的作業不存在,或屬於其他身分。下一步使用完全相同的原始 id,以及相同的使用者/金鑰/群組。

別名

模型別名

Ailoot Ultra google/gemini-2.5-pro:batch

方法路徑別名

請使用上方列出的 API 方法路徑。

相關呼叫用 ID

google/gemini-2.5-pro:batch

FAQ · Google: Gemini 2.5 Pro (batch)
可以使用哪些輸入與結果?

POST /v1/batches · google/gemini-2.5-pro:batch: text → text

請求使用哪些欄位?

POST /v1/batches · google/gemini-2.5-pro:batch: endpoint, model, requests, completion_window, provider

適用哪些限制?

POST /v1/batches · google/gemini-2.5-pro:batch: requests.min_items: 1

更多詳情

將 Ailoot 串接 Claude Code、OpenCode、Hermes 或自己的應用程式。

公司及其專案組合

公司及其專案組合:數百萬客戶,每月銷售額達數十億。

優惠購買 token。

訂閱優惠適合持續工作,折扣碼購買 token 最高可折 50%。

訂閱
為定期請求選擇優惠方案。
最高 50% 折扣碼
購買時輸入代碼,價格依活動重算。
歷史中的費用
每次請求保存模型、token 與金額。

選擇訂閱 · 查看模型價格

將 API 加入 你銷售的產品。

依 Ailoot 正式服務條款與授權合約串接 SaaS、應用程式與機器人;轉售請申請經銷授權。

商用應用程式
在付費功能加入文字、圖片、影片與聲音生成。
經銷授權
提供專案說明與存取方式,要求書面使用和轉售條件。
網站文件
串接前可閱讀正式服務條款、授權合約與資料處理政策。

申請經銷授權 · 正式服務條款與授權合約