Generate API test files from endpoint docs

They used Cursor to turn endpoint descriptions into runnable .http tests and checks inside the editor.

Done with Cursor· Intermediate· Mar 2025

What they did
A developer built a Cursor extension so API testing could happen without leaving the editor. They fed Cursor’s agent endpoint docs, or described the routes directly, and asked it to produce .http files with requests, test code, and assertions. Those files were then executed through the extension, which relies on their open-source t-req engine to keep requests scriptable.
How it went
This created a local loop where the agent could draft API tests and the developer could iterate in place instead of copying tokens or switching tools. The setup was said to run locally and not require an account. No timing data or hard limits were given.
Tips
This works best when each endpoint is described clearly, including method, path, and expected behavior. Because the testing flow depends on the author’s extension and t-req engine, it is most useful for teams already comfortable working inside the editor.

Try it yourself with Cursor

I’m documenting an API with these endpoints: [method, path, purpose, example inputs, expected outputs]. Create a set of .http test files in [folder path] with one request per endpoint, including at least one success case and one error case where appropriate. Add assertions for status code and important response fields, use [base URL] as a variable, and pause before any step that would send real requests or make changes outside the test files. After the files are created, show me which checks should pass and which are likely to fail.

Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.

Get 3 agent uses like this every morning

With the day's top AI news. Free, and one click to unsubscribe.