Tool calling turns a model from a text generator into something that acts. When a user asks for live data, the model emits structured JSON naming a function and its parameters, and your application executes the call against a live API Blaxel's function calling guide. The model proposes; your code disposes. That split is exactly where a rate limiter belongs.
The problem is volume. An agent given one prompt may fan out into dozens or hundreds of calls to LLM providers, vector databases, third-party APIs and internal services, and a recursive loop or a malicious prompt can turn a minor logic error into a cost spike within minutes NeuralTrust's agent throttling guide. A cap applied to the account as a whole protects your bill, but it does not protect the write tool that a single runaway agent is hammering in a tight loop.
So the useful unit is the tool, or the tool-and-caller pair. A coding agent that reads pull request diffs and runs the test suite orchestrates several function calls per review, and each of those functions has different risk Blaxel. Reading a diff twice is harmless. Creating a duplicate ticket twice is not. The cap window should encode that difference, which means choosing a different algorithm for reads and writes rather than a single global bucket.
One more distinction matters before the algorithms. Rate limiting is a hard security and abuse control (requests per second, tool calls per hour), while throttling is a softer fairness and load control (queue depth, latency targets) NeuralTrust. The algorithms below are rate limiters. They refuse. If you want smoothing without refusal, put a queue in front and throttle there.



