# Do AI coding agents handle non-REST APIs? 1,356 runs say yes

> In a Microsoft study published on 23 November 2026, six models ran 1,356 agent tasks against the same API built three ways (REST, POST-only and RPC). With an OpenAPI description, all three styles scored 99.7% to 100%. Without docs, REST still reached 93% to 97% but RPC scored 0%. Discoverable docs mattered far more than API style.

Published 2026-11-23 by the CodeBeast Team · https://codebeast.ai/blog/ai-coding-agents-non-rest-apis

If you are designing an API and wondering whether AI coding agents will cope with something other than REST, Microsoft has run the experiment. In [a post published on 23 November 2026](https://developer.microsoft.com/blog/do-ai-coding-agents-struggle-with-non-rest-apis/), Waldek Mastykarz describes 1,356 agent runs against the same API built in three styles. The result is useful for API owners and for anyone building agents: when agents could read the docs, API style made no measurable difference. When they couldn't, only REST was usable.

## How the test was set up

The study used a fictional inventory API called Binstock, with bins and items, so no model could have seen it during training. It was built three ways, with identical data and behaviour:

| Style | Example update call | What it isolates |
|---|---|---|
| REST | `PATCH /bins/B-103` | The baseline |
| POST-only | `POST /bins/B-103/update` | Keeps resource paths, drops PUT, PATCH and DELETE |
| RPC | `POST /updateBin?code=B-103` | Verb-named endpoints |

The API was mocked with [Dev Proxy](https://aka.ms/devproxy) and its [CrudApiPlugin](https://learn.microsoft.com/en-us/microsoft-cloud/dev/dev-proxy/technical-reference/crudapiplugin), with data reset for every run. Undefined paths or methods returned 404, and every wrong guess was logged. Agents ran in the [Vally](https://aka.ms/vally) harness, using the GitHub Copilot SDK.

There were 15 tasks: five reads and ten writes, covering creates, partial updates, full replaces, deletes, multi-step changes and bulk changes. Prompts described the outcome rather than the operation, because naming the operation would have given away the RPC endpoint names. One task was a trap: it asked for a single-field change where a full replace would wipe the other fields.

Grading was state-based. After each run the grader compared the whole API state with the seed data plus the intended change, so any valid route to the right state passed. The decision rules were set before running: two styles counted as equivalent if the 95% confidence interval on the difference in success rate stayed within 10 points, and a general claim needed at least three models agreeing with none disagreeing.

Six models from two vendors took part: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.1 Sol, GPT-6.1 Terra, Claude Haiku 5.5 and MAI Code 2 Flash.

## Finding 1: with docs, every style tied

In the main run, agents got the base URL and an OpenAPI description. The description listed the operations but did not explain how replace and update differ. Four models ran each task five times per style, 900 runs in total.

| Style | Success | Runs with no failed call | Tokens per run |
|---|---|---|---|
| REST | 100% | 82% | about 70k |
| POST-only | 100% | 82% | about 70k |
| RPC | 99.7% | 77% | about 71k |

The single RPC failure was a 10-minute timeout. RPC had about five points fewer failure-free runs and used roughly 1% more tokens, neither of which the author treats as significant. Every model came out equivalent in every comparison. The two smaller models, Haiku 5.5 and MAI Code 2 Flash, also completed every task in every style, with token use within about 3%.

## Finding 2: without docs, RPC was unusable

Two models, Sonnet 5.5 and GPT-6.1 Terra, were then given only the base URL.

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

No model ever guessed `/updateBin`. RPC agents averaged about 28 failed calls before giving up. POST-only landed in the middle: its reads use REST-style paths that agents could find, but the `/update` and `/delete` writes were not guessable. Even REST agents averaged about 10 failed calls per task, with the 404s steering them towards the right URLs.

The token numbers here need care. POST-only used 48% to 56% more tokens than REST, and per correct result REST cost about 80k tokens against about 230k for POST-only. RPC looked cheap only because the agents gave up early.

## Finding 3: in a realistic workflow, still a tie

The last experiment was closer to real work. Agents got a small Node.js project with a `handover.md` asking them to fix an off-by-one `getMonth()` bug, apply two to four inventory events to Binstock and write a daily report. The project README linked to an HTML API reference page. Sonnet 5.5 and GPT-6.1 Terra ran eight handovers twice per style, 96 runs. All of them succeeded, all found and used the reference page, and token use was within 3% across styles.

## What to change if you own an API

The conclusion is not "use REST". It is "make your docs findable". With docs, the style did not matter; without them, success depended on whether URLs could be guessed. Practical steps from the post and its data:

1. **Link an OpenAPI description from your docs and your README.** In the handover runs, agents found the reference page through the README every time. A spec that exists but is not linked from where agents start is close to useless to them.
2. **Treat 404s as a feedback channel.** Agents used 404 responses to correct course on REST and POST-only APIs. The author suggests, without having tested it, listing operations at the root URL or in 404 response bodies so an agent without docs can still find endpoints. For an RPC API this is the obvious next step.
3. **Mine agent traces for guessed URLs.** If agents repeatedly try `GET /bins/{id}/items` before finding the real route, that is a documentation gap or an API design hint. Your gateway logs already contain this data.
4. **Spell out the risky semantics.** The OpenAPI description in the study did not explain replace versus update, and the trap task targeted exactly that difference. If a call can destroy data, say so in the operation description.

The same lesson applies when you wire an internal API into an agent. In CodeBeast, a [custom API integration](/docs/custom-api) has a description field that the agent reads and an API docs URL it can use to look up endpoints, so a specific description with real endpoint examples is worth more than a clever API shape.

## What to take from it if you build or evaluate agents

The author makes a point that is easy to miss: be clear what you are measuring. Giving the agent docs tests whether it can *use* an API; withholding them tests *discovery*, which favours REST's guessable paths. A benchmark that quietly mixes the two will produce confusing results. State-based grading is also worth copying: checking the final state of the system, rather than the exact calls made, lets agents take any valid path and still catches the full-replace trap. For more on that kind of eval design, see our write-up of [Hugging Face's guide to agentic evaluations](/blog/agentic-evaluation-guide).

## Limits and open questions

The API had a handful of endpoints, no authentication and no pagination. The author lists follow-ups: self-describing RPC APIs without docs, around 100 endpoints with similar names (such as `updateBin` and `updateBinItems`), authentication and pagination, longer workflows, and the same tests in other agent harnesses. All runs used one harness, so results in other agents may differ. The post does not link a public dataset or repository, so the numbers cannot yet be independently reproduced.

## Sources

- [Microsoft for Developers: Do AI coding agents struggle with non-REST APIs?](https://developer.microsoft.com/blog/do-ai-coding-agents-struggle-with-non-rest-apis/)
- [Dev Proxy](https://aka.ms/devproxy)
- [Dev Proxy CrudApiPlugin reference](https://learn.microsoft.com/en-us/microsoft-cloud/dev/dev-proxy/technical-reference/crudapiplugin)
- [Vally](https://aka.ms/vally)

## FAQ

### Do AI coding agents work with RPC-style APIs?

Yes, if they can read documentation. In Microsoft's test, RPC scored 99.7% with an OpenAPI description, against 100% for REST. Without any docs, RPC scored 0% because no model guessed the verb-named endpoints.

### Is REST better for AI agents than other API styles?

Only when agents have no documentation. Without docs, REST reached 93% to 97% success because its paths follow guessable conventions. With docs, REST, POST-only and RPC were statistically equivalent across six models.

### How can I make my API easier for AI coding agents to use?

Publish an OpenAPI description and link it from your docs and README, describe destructive operations clearly, and return helpful 404 responses. The study's author also suggests, untested, listing available operations at the root URL or in 404 bodies.

### Which models were tested in the Microsoft API style study?

Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.1 Sol and GPT-6.1 Terra ran the main 900-run comparison. Claude Haiku 5.5 and MAI Code 2 Flash were tested as smaller models, and Sonnet 5.5 and GPT-6.1 Terra ran the no-docs and handover experiments.
