All posts
Guides7 min read

What agentic coding needs from an API

A gateway that handles chat traffic flawlessly can still break coding agents. Agents exercise parts of the API surface that ordinary chat never touches, and they fail in ways that are hard to attribute — a stalled loop looks like a model problem long before anyone suspects the proxy.

Four requirements

1. Exact tool-call fidelity

Agents depend on precise tool-call semantics: stable call indexes across streaming deltas, correct handling of parallel calls, and preserved argument encoding. A gateway that reorders, re-indexes, or coalesces these will produce agents that mysteriously lose track of which tool returned what. See tool calling.

2. Passthrough of unknown fields

Providers ship new parameters constantly. A gateway that validates strictly against a fixed schema silently drops fields the model needed. Agentic features tend to be the newest and therefore the first to be dropped.

3. Cache-preserving request handling

Agent loops resend near-identical prefixes at every step, making prompt caching unusually valuable. A gateway that reorders message content or injects its own preamble destroys prefix stability and the cache hit rate with it.

4. Trajectory-level cost control

Per-request budgets are the wrong unit for agents. One task legitimately spans dozens of calls; the meaningful limits are per-task cost and per-task step count. Optimizing each call in isolation produces agents that pick cheap models, loop more, and cost more overall.

Neural Router's Agent service type optimizes cost per successful trajectoryrather than per call, and preserves tool-call structure and message ordering end to end.

Practical setup for specific tools is in the coding tools guide; for model selection see the best LLM for coding.

Keep reading