Custom Input for AI Agent Model

N8N OpenRouter Problem

Hello, im looking for a solution for an OpenRouter Problem. I have a Workflow and im using an AI Agent with Open Router as a Model. Now I want to track the cost and there i a parameter for OpenRouter called “usage” and in an HTTP Request i can add this but not in an AI Agent. Is there a way to add this parameter to the call over an AI Agent?

Information on your n8n setup

  • n8n version:
    1.113.3
  • Self hosted

Hi @Flantox ,

Unfortunately there’s no way to directly access the tokens usage from the tool node. There’s a workaround though which uses an n8n node to get the execution details which contains the tokens usage from the model tool node. You can see details in this answer.