OpenRouter Smart Tool icon

OpenRouter Smart Tool

AI Tool with intelligent model selection for AI Agents

OpenRouter Smart Tool

AI-generated

Summary

Configure and initialize a dynamic AI tool for complex query processing with OpenRouter, which automatically selects the optimal AI model based on the specified task category and budget, and uses a customizable system prompt and input schema to control behavior and inputs.

Inputs

  • Tool Name — Name of the tool, used by AI agents to invoke it.
  • Tool Description — Description to help AI agents decide when to use this tool.
  • System Prompt — An optional system prompt to set the behavior of the AI model.
  • Input Schema (required) — JSON Schema defining the expected input parameters for the tool, guiding agent input formatting.
  • Task Category (required) — Type of task (e.g., General Chat, Coding, Summarization) to guide intelligent model selection.
  • Budget (required) — Budget preference (Cheap, Balanced, Premium) influencing model selection prioritizing cost or quality.
  • Options — Additional options including Temperature (controls response randomness), Max Tokens (max output tokens), and JSON Mode (whether to force JSON output format).
  • Logging — Logging settings, including enabling debug logs for model selection and API call details.

Output shape

a single AI tool object configured for use in workflows, exposed via the AiTool output connection.

The tool dynamically fetches and selects the best available AI model from a Supabase catalog filtered for activity and policy compliance. It communicates with the OpenRouter AI completion API, applying optional JSON output formatting and provider QoS exclusions. The output is the AI model's response as a string or JSON stringified if JSON Mode is enabled. Debug logging and telemetry capture detailed request and selection metadata. Error conditions during model fetch or API call will throw exceptions and be surfaced as node errors.

Links

Discussion