所有伺服器工具

Datetime

openrouter:datetime

為模型提供可靠的時間脈絡。當提示詞取決於今天的日期或目前時間時,模型會呼叫此工具,OpenRouter 則會傳回目前的日期與時間,並可選擇使用設定的時區。

運作方式

適用於取決於目前日期或時間的提示詞,例如排程和截止時間。

  1. 您的模型 在需要今天的日期或時間時呼叫工具。

  2. OpenRouter 傳回目前的日期與時間,使用 UTC 或您設定的時區。

  3. 您的模型 根據實際日期回答,而不是從訓練資料中猜測。

供應商與定價

  • OpenRouter

    免費

    在請求期間於 OpenRouter 的處理程序內執行。

每個請求皆適用標準模型 token 費用。

使用此工具

OpenRouter 會在請求期間執行工具,並將結果傳回模型,因此不需要用戶端工具迴圈。

支援的 API:Chat Completions, Responses, and Anthropic Messages。

Shell
curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "openai/gpt-5.2",
  "tools": [
    {
      "type": "openrouter:datetime"
    }
  ],
  "messages": [
    {
      "role": "user",
      "content": "How many days are left until the end of this quarter?"
    }
  ]
}'

設定、參數與範例請參閱文件。

閱讀整合指南

常見問題