AI coding agents handle non-REST APIs as well as REST ones, provided they can read the documentation. A test spanning 1,356 runs across six models from two vendors found no real difference in success rate, failed calls or token cost between REST, POST-only and RPC-style APIs. The result matters for any team asking whether AI coding agents can cope with older or unconventional interfaces.
Without docs, the picture flips. REST comes out well ahead, since agents can infer REST URLs from convention but have no way of guessing that another API calls an endpoint /updateBin.
Why non-REST APIs looked risky
REST maps intent onto HTTP methods: PATCH changes a record and DELETE removes it. With an RPC-style API, the agent has to learn each endpoint’s name and purpose. Some APIs go further and send every write over POST.
The testers expected a cost. A model trained on plenty of REST could try DELETE by habit and get a 404. Facing a dozen verb-named endpoints, it could pick a full replace over a partial update and erase data. Either failure would show up as lost tasks, extra calls or extra tokens.
How the test worked
The team invented an inventory API named Binstock, covering bins and their contents, so no model could know it in advance. They served identical data and behavior in three styles. The same partial update looked like this:
- REST: PATCH /bins/B-103
- POST-only: POST /bins/B-103/update
- RPC: POST /updateBin?code=B-103
The POST-only style pulls the two changes apart. It keeps REST’s resource paths but removes PUT, PATCH and DELETE, so setting it against REST shows the effect of the HTTP methods, and setting it against RPC shows the effect of naming.
Each style was mocked with Dev Proxy and its CrudApiPlugin, using in-memory data reset for every run. Any undefined path or method returned a 404, so every bad guess was recorded in the proxy log.
There were 15 tasks, five reads and ten writes, spanning creation, partial and full updates, removal, chained steps and batch edits. Prompts described the outcome, such as a bin being taken out of service, instead of naming an operation that would hand over the RPC endpoint name. One task was a trap: edit a single field on a bin, where overwriting the whole record would erase the rest.
A grader checked that the final data matched the starting data plus the requested change and nothing more. The team fixed its rules before the first run. Two styles counted as equivalent when the 95% confidence interval on their success-rate gap stayed inside 10 points, and a broad conclusion required three or more models to agree with none dissenting.
With docs, the three styles tied
In the main run, agents got the base URL and an OpenAPI description. Four models took part: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.1 Sol and GPT-6.1 Terra. Each repeated every task five times per style, for 900 runs.
RPC’s single failure was a timeout after ten minutes. It also had about five points fewer clean runs with no failed call, though that gap wasn’t significant. REST saved around 700 tokens per run, about 1%. Every model came out equivalent in every comparison.
Two smaller models, Claude Haiku 5.5 and MAI Code 2 Flash, ran each task twice. Both completed everything in all three styles, and their token counts varied by about 3% at most.
Without docs, agents guessed and failed
For the no-docs test, Claude Sonnet 5.5 and GPT-6.1 Terra received just the base URL and did each task twice per style. Neither ever guessed a name like /updateBin. On the RPC API they racked up about 28 failed calls on average before quitting.
POST-only landed in between, since its reads share REST’s paths while writes needed /update or /delete endpoints. REST runs mostly succeeded, with about 10 failed calls per task before agents found the right URLs.
Per correct result, REST cost about 80,000 tokens and POST-only about 230,000. RPC never produced a correct result. It only looked cheap because agents quit early.
Bigger tasks gave the same answer
In a final test, the agent got a small Node.js project and one instruction: handle the day’s shift handover. That meant repairing a broken unit test, traced to an off-by-one error in getMonth(), applying two to four floor events to Binstock and writing a report. The README linked to an HTML reference page with the same information as the OpenAPI description.
Claude Sonnet 5.5 and GPT-6.1 Terra each handled eight handovers twice per style, 96 runs in all. Every run succeeded and found the reference page. Token use stayed within 3% across styles. Runs without a failed call were 72% for POST-only, 84% for REST and 81% for RPC, a gap that wasn’t significant.
What API owners should do next
Owners of non-REST APIs don’t need to redesign them. Put the effort into getting agents to your docs by linking an OpenAPI description from the documentation and README. A further idea, still untested, is having the API list its operations at its root URL or in 404 responses.
The testers plan to try that self-describing approach, scale up to an API with a hundred endpoints and near-identical names like updateBin and updateBinItems, and add auth and pagination. REST isn’t flawless either: agents without docs still made about 10 failed calls per task.
Anyone evaluating agents against an API should decide what they’re measuring. Giving them docs tests usage. Withholding them tests discovery, which favors REST by design.
Source: Microsoft for Developers