cd /news/ai-agents/do-ai-coding-agents-struggle-with-no… · home › topics › ai-agents › article
[ARTICLE · art-174992] src=devblogs.microsoft.com ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Do AI coding agents struggle with non-REST APIs?

AI coding agents succeeded just as often with REST, POST-only and RPC-style APIs when documentation was available, across 1,356 runs with six models from two vendors, according to a Microsoft Dev Proxy experiment on a fictional inventory API called Binstock. Without docs, REST won by a wide margin because agents can guess REST URLs from convention but cannot guess what a non-REST API names its endpoints. The test served one API in three styles via Dev Proxy's CrudApiPlugin and graded 15 tasks (5 reads, 10 writes) by checking full API state against seed data plus the intended change.

recommendation

Give agents documentation for non-REST APIs whose endpoints are verb-named; the source found docs erased the REST advantage across 1,356 runs, while undocumented non-REST APIs failed far more often.

more in playbook: Designing agent systems
by read10 min views1 publishedNov 23, 2026
Do AI coding agents struggle with non-REST APIs?
Image: Devblogs (auto-discovered)

Plenty of APIs skip REST conventions. Some send every write over POST, and some name every endpoint after an action, like /updateBin or /deleteBin. On paper, agents should have a harder time with those. REST maps the intent onto the HTTP method, so changing a record is a PATCH and removing it is a DELETE. In comparison, an RPC-style API makes the agent work out what each endpoint is called and what it does. We expected that to cost agents something, either in failed tasks or in extra calls and tokens.

It didn’t, at least when the agent had the docs. Across 1,356 runs with six models from two vendors, agents succeeded just as often with REST, POST-only and RPC-style APIs, at the same cost in failed calls and tokens. Without docs, REST won by a wide margin, because agents can guess REST URLs from convention and have no way to guess what a non-REST API calls its endpoints.

Where non-REST APIs could trip up an agent #

“Non-REST” usually changes two things at once. It limits the API to GET and POST, and it replaces resource paths with endpoints named after verbs, and either change could cost an agent. A model that has seen a lot of REST might reach for DELETE out of habit and get a 404. A model faced with a dozen verb-named endpoints might pick the wrong one, for example a full replace where a partial update was needed, and wipe data it was supposed to keep. If that happened, agents would complete fewer tasks or need more failed calls and tokens to get there, so we measured both.

One API, three styles #

We built a fictional inventory API called Binstock, with bins and the items stored in them, so no model could have memorized it. We served it in three styles with identical data and behavior. Here’s the same partial update in each:

PATCH /bins/B-103

POST /bins/B-103/update

POST /updateBin?code=B-103

The middle style is there to separate the two changes. POST-only keeps the resource paths from REST but drops PUT, PATCH and DELETE, so comparing it with REST isolates the HTTP methods. Comparing it with RPC isolates the naming.

Operation REST POST-only RPC
Read a bin GET /bins/{code} GET /bins/{code} GET /getBin?code=…
Create a bin POST /bins POST /bins POST /createBin
Replace a bin PUT /bins/{code} POST /bins/{code}/replace POST /replaceBin
Update a bin PATCH /bins/{code} POST /bins/{code}/update POST /updateBin
Delete a bin DELETE /bins/{code} POST /bins/{code}/delete POST /deleteBin

We mocked each style with Dev Proxy and its CrudApiPlugin, with in-memory data that reset for every run. Any path or method a style didn’t define returned a 404, so a DELETE against the RPC API failed just like it would against a real one, and every wrong guess showed up in the proxy log. We’ve written before about why mocks like this make evals repeatable. Here, they also let us serve one API in three shapes without building three servers.

We wrote 15 tasks, 5 reads and 10 writes, covering creates, partial updates, full replaces, deletes, multi-step changes and bulk changes. The prompts described the outcome the user wanted. A task said “Bin B-103 has been taken out of service”, because a prompt that names the operation, like “update” or “delete”, hands the agent the name of the matching RPC endpoint. One task was a deliberate trap that asked to change a single field on a bin, where a full replace would have wiped the others.

After each run, the grader read the full state of the API and checked that it equaled the seed data plus the intended change and nothing else, so any valid route to the right result passed. We ran everything in Vally with the GitHub Copilot SDK as the agent, and we set the decision rules before the first run. We’d call two API styles equivalent if the 95% confidence interval on their difference in success rate stayed within 10 points, and a general claim needed at least three models agreeing with no model pointing the other way.

With the docs, every style scored the same #

In the main run, the prompt gave the agent the base URL and an OpenAPI description of the API. The description listed every operation but didn’t explain how replace and update differ, so the agent still had to work that out. Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.1 Sol and GPT-6.1 Terra each ran every task five times in every style, 900 runs in total.

Style Success Runs without a failed call Tokens per run
REST 100% 82% ≈70k
POST-only 100% 82% ≈70k
RPC 99.7% 77% ≈71k

The single RPC failure was a 10-minute timeout. RPC had about 5 points fewer runs without a failed call, which hints at a little more stumbling, but the difference wasn’t significant. REST used about 700 fewer tokens per run than RPC, roughly 1%. Each model came out equivalent in every comparison, including the ones that isolate the HTTP methods and the naming.

Still, the styles might have tied only because these models are too strong for the tasks, so we ran the same setup on two smaller models, Claude Haiku 5.5 and MAI Code 2 Flash, twice per task. Both completed every task in every style, with token use within about 3% across styles.

Without the docs, agents had to guess #

Most agents can reach some documentation, which is why the docs run was the primary test. To see what happens when they can’t, we gave Claude Sonnet 5.5 and GPT-6.1 Terra only the base URL and ran every task twice per style.

Model REST POST-only RPC
Claude Sonnet 5.5 93% 40% 0%
GPT-6.1 Terra 97% 60% 0%

No model ever guessed an endpoint like /updateBin. On the RPC API, agents averaged about 28 failed calls and then gave up. POST-only landed in the middle because its reads use the same paths as REST, so agents found them, while writes that needed /update or /delete endpoints failed.

REST runs mostly succeeded, but agents still averaged about 10 failed calls per task before they found the right URLs. Convention gets an agent close to a REST endpoint, and the 404s steer it the rest of the way.

The token numbers look strange until you read them per correct result. POST-only used 48% to 56% more tokens than REST, because partial success kept agents probing, and its failed runs cost 160k to 170k tokens each. RPC looked cheap only because agents gave up early. Per correct result, REST cost about 80k tokens, POST-only about 230k, and RPC never got there.

Inside a bigger task, the styles still tied #

All of this used short tasks, about four API calls each with the docs, with an OpenAPI description handed to the agent in the prompt. In practice, an API call is usually one step in a larger piece of work, and the docs are a reference page the agent has to find. So we built a small Node.js project with a handover.md file and gave the agent one instruction:

Please take care of today's shift handover in handover.md.

The handover asked the agent to fix a failing unit test, caused by an off-by-one getMonth() bug, and to apply two to four floor events to Binstock before writing a daily report, sometimes with a question about the inventory on top. The project’s README linked to the API and to an HTML reference page served by the mock. We modeled the page on the Dev Proxy API reference, with a section for every operation describing its request and response, so it held the same information as the OpenAPI description, in prose.

Claude Sonnet 5.5 and GPT-6.1 Terra ran 8 handovers twice in each style, 96 runs in total. Every run succeeded, and every run found the reference page through the README link and used it correctly. Token use was within 3% across styles, because the coding and the report dominated the cost. POST-only had slightly fewer runs without a failed call, 72% against 84% for REST and 81% for RPC, but neither that nor the difference in failed calls was significant.

What we’d test next #

We kept Binstock deliberately small and simple, and here are a few ideas for follow-up research.

One idea would be to test the middle ground between handing the agent the docs and giving it nothing. Serve an RPC API that lists its operations at the root URL or in the body of every 404, and run the no-docs tasks again. If agents then complete anywhere near the 95% of tasks they managed on REST, an RPC API can make itself usable to agents that never see its docs.

Another would scale up the API. An RPC API with a hundred endpoints, some with near-identical names like updateBin and updateBinItems, would show whether agents start picking the wrong one once the list gets long. Adding auth and pagination, which most real APIs need, would show whether the extra steps hit one style harder than the others. Our longest tasks took about nine API calls, so a workflow with dozens of dependent calls would show whether RPC’s slightly lower share of runs without a failed call adds up over a longer session.

The handover experiment changed the task size and the docs format at once, so if one style had done worse, we couldn’t have said which change caused it. Running the short tasks with the prose reference, and the handover with the OpenAPI description, would tell the two apart. And since every run used the GitHub Copilot SDK in Vally, repeating the tasks in other harnesses would show whether the results hold beyond this one.

What to do with your API #

If you maintain a non-REST API, you can leave its style as it is. With docs in reach, the agents we tested used POST-only and RPC APIs as well as REST, at the same cost. Put the effort into getting agents to those docs, because without them an agent has no way to arrive at /updateBin. Link an OpenAPI description from your docs and your README. Consider making the API describe itself, for example by listing the available operations at the root URL or in the body of a 404. We haven’t tested that yet, but it gives an agent that arrives without docs a way to find the right endpoint.

REST APIs have room to improve too. Agents without docs made about 10 failed calls per task even on REST, and the same trajectory analysis that surfaces a guessed URL in your docs will surface a guessed endpoint in your API.

If you evaluate agents against an API, decide whether you’re testing how well they use it or how well they find their way around it. Handing the agent the docs tests usage, and in our runs every style passed. Leaving the docs out tests discovery, which favors REST by design because its URLs follow a convention agents can guess. Both are useful questions, but a hidden choice in your setup can decide which one you’re answering.

So, do AI coding agents struggle with non-REST APIs? #

None of the agents we tested struggled with non-REST APIs, as long as they could read the docs. From Claude Opus 5.5 down to MAI Code 2 Flash, every model used POST-only and RPC APIs as reliably and as cheaply as REST. Like with CLI args and JSON, the plausible story didn’t survive measurement.

What agents struggle with is guessing, and REST is easier to guess. Claude Sonnet 5.5 and GPT-6.1 Terra completed none of the RPC tasks without the docs, and nearly all of them with the docs.

── more in #ai-agents 4 stories · sorted by recency
── more on @binstock 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/do-ai-coding-agents-…] indexed:0 read:10min 2026-11-23 · —