The difference here is that we are not showing just output tokens, but input tokens as well. Running the query on my end, here's a breakdown:
With web search on:
- output tokens = 22
- input tokens = 1588
- total tokens = 1610
With web search off:
- output tokens = 24
- input tokens = 1098
- total tokens = 1122
With input tokens, we give it instruction on things like formatting, personalization, etc. Any search results are counted in these input tokens as well, among other things. Through openrouter you are likely not setting any of these instructions.