An AI agentAn AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.Full definition →'s application must decide when tool useA model's ability to call external functions — run code, search the web, edit files — instead of only generating text.Full definition → stops, even when the model keeps requesting actions. OpenRouter'sloop tutorial illustrates this with a fixed turn limit and repeated-call detection. Each tool result normally returns to the model for another decision. On the final permitted turn, however, the application stops before executing newly requested tools, because there would be no subsequent turn to interpret their results. This places the execution boundary in application code instead of depending entirely on the model to finish.
Terms in this piece · Glossary
AI agent — An AI system that doesn't just answer once but works toward a goal in a loop — taking actions, reading the results, and deciding what to do next.
tool use — A model's ability to call external functions — run code, search the web, edit files — instead of only generating text.
agentic loop — The cycle an agent runs in: decide, call a tool, read the result, decide again — repeating until the goal is met or a stop condition fires.
model routing — Sending each request to a model chosen by the difficulty of the task, rather than using one model for everything.