跳转到内容
Alpha
  • 模型
  • 排行榜
  • Ori
联系销售

页脚

OpenRouterOpenRouter
© 2026 OpenRouter, Inc

产品

  • 聊天
  • 排行榜
  • 基准测试
  • 应用
  • 发现
  • 模型
  • Ori
  • 合集
  • 提供商
  • 工具
  • 定价
  • Business
  • Enterprise
  • 实验室

公司

  • 关于
  • 博客
  • 客户
  • 招聘
    招聘
  • 隐私
  • 服务条款
  • 信任中心
  • 支持
  • 兼容 OR
  • 数据
  • 品牌

开发者

  • 文档
  • API 参考
  • 开发者平台
  • 状态
  • AI 站点地图

连接

  • Discord
  • GitHub
  • LinkedIn
  • X
  • YouTube
所有服务器工具

Tool search

openrouter:tool_search

文档

避免将大型工具库放入提示词。将您自己的工具标记为 defer_loading,模型就会搜索所需的工具,从而不再让数百个工具定义在每轮消耗输入 token,同时保持工具选择的准确性。

文档
工作原理提供商和定价使用此工具相关工具

工作原理

适用于大型工具库:大致超过 10 个工具或工具定义超过 10k token 的情况。低于此规模时,标准工具调用更简单。

  1. 1

    您的应用 将函数工具标记为 defer_loading,使其不包含在提示词中。

  2. 2

    您的模型 在需要工具时,使用模式搜索延迟加载的工具。

  3. 3

    OpenRouter 根据名称、描述和参数显示最佳匹配项。

  4. 4

    您的应用 像处理其他函数调用一样处理对已公开工具的调用。

提供商与定价

  • https://openrouter.ai 的网站图标

    OpenRouter

    免费

    在请求期间于 OpenRouter 的进程内运行。

每个请求均按标准模型 token 费用计费。

使用此工具

将您自己的函数工具标记为 defer_loading。OpenRouter 在服务端运行搜索并向模型提供匹配的工具,您的应用则像处理其他函数调用一样处理这些已提供工具的函数调用。

可通过 API 使用。 仅影响将其他工具标记为 defer_loading 的请求,而 Chatroom 不会这样做。

支持的 API:Responses and Anthropic Messages。

shell
curl https://openrouter.ai/api/v1/responses \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "openai/gpt-5.2",
  "tools": [
    {
      "type": "openrouter:tool_search"
    },
    {
      "type": "function",
      "name": "book_restaurant",
      "description": "Reserve a restaurant table for a party at a given date and time.",
      "parameters": {
        "type": "object",
        "properties": {
          "party_size": {
            "type": "integer",
            "description": "Number of guests."
          },
          "datetime": {
            "type": "string",
            "description": "Reservation time as an ISO 8601 timestamp."
          }
        },
        "required": [
          "party_size",
          "datetime"
        ]
      },
      "defer_loading": true
    },
    {
      "type": "function",
      "name": "create_calendar_event",
      "description": "Add an event to the user’s calendar.",
      "parameters": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Event title."
          },
          "start": {
            "type": "string",
            "description": "Start time as an ISO 8601 timestamp."
          }
        },
        "required": [
          "title",
          "start"
        ]
      },
      "defer_loading": true
    }
  ],
  "input": "Book me a table for four tomorrow night and add it to my calendar."
}'

文档中提供了设置、参数和示例。

阅读集成指南

相关工具

实用工具

  • Datetime

    Give any model the current date and time, in UTC or a configured timezone

    实用工具