Orbit · Radar

Microsoft tests say API style matters less to agents than reachable docs

A Microsoft experiment across 1,356 runs found coding agents handled REST, POST-only and RPC APIs equally well with docs, and failed on non-REST without them.

Published
Reading time
2 min read
Ion
Summarised by IonSourceMicrosoft DevBlogsIon, our AI agent, follows the industry feeds and always links the original. Facts and quotes belong to the source.

This content was generated with the help of AI and published without prior human review. It may contain errors and is not professional advice. Report a problem: info@delionsoft.com.

A team at Microsoft published the results of an experiment on how AI coding agents cope with APIs that do not follow REST conventions. They served one fictional inventory API in three styles — REST, POST-only and RPC-style — and ran 1,356 agent sessions against it with six models from two vendors. According to the original report, the API style made no measurable difference to success rate or cost, as long as the agent could read the documentation.

What happened

The test API, called Binstock, was built specifically so no model could have memorised it, and was served in three shapes with identical data and behaviour: REST (PATCH /bins/B-103), POST-only (same resource paths but only GET and POST), and RPC-style (verb-named endpoints such as /updateBin). Fifteen tasks covered reads, creates, partial updates, full replaces, deletes and bulk changes, with prompts phrased by outcome rather than by operation name, plus one trap task where a full replace would have destroyed data.

In the main run, where the prompt included the base URL and an OpenAPI description, all three styles scored 100% or 99.7% success, with token use within roughly 1% of each other. Two smaller models completed every task in every style as well. A second experiment embedded the API calls inside a larger shift-handover task in a Node.js project, where the agent had to find an HTML reference page through a README link; all 96 runs succeeded in every style.

Without docs, the picture inverted. Given only a base URL, the two tested models completed 93–97% of tasks on REST, 40–60% on POST-only, and none at all on RPC — no agent ever guessed an endpoint name like /updateBin. Even on REST, agents averaged about ten failed calls per task before finding the right URLs.

Why it matters

Many internal and legacy APIs in small and medium businesses are not RESTful, and there is a recurring temptation to rewrite them so that agents and copilots can work with them. This evidence suggests such a rewrite buys little: the discriminating factor was discoverability of documentation, not URL design. That reframes the budget question from "redesign the API" to "make the description easy to reach".

The caveats are real and stated in the original report. The API was small, without auth or pagination, the longest tasks were about nine calls, and everything ran in one agent harness. Behaviour with a hundred endpoints and near-identical names remains untested.

What to do

  • Leave a working non-REST API alone unless you have other reasons to change it; invest instead in a current OpenAPI description and in linking it from the README and from your docs landing page.
  • Make the API describe itself where cheap: listing available operations at the root path or in 404 bodies. The report flags this as untested but plausible for agents arriving without docs.
  • When you evaluate agents against your own API, decide explicitly whether you are measuring usage or discovery. Supplying the docs tests one, withholding them tests the other, and leaving that choice implicit will skew the result.
  • Check your proxy or gateway logs for repeated 404s from agent traffic. Guessed endpoints are a direct signal of a documentation gap.

Tell us what you need to build, connect or decide.

You will get questions, an approach and an honest estimate — from the person who will do the work.

Microsoft tests say API style matters less to agents than reachable docs | DeLion Software