Improve an API test suite with AI, one reviewed change at a time

Writing the first few checks is quick. Going through forty requests to add "save the token here, use it there, check the id format everywhere" is the tedious part. The AI tab in a test suite drafts those edits from a sentence and shows them to you as a list before anything changes.

What it can change

The answer is a list of edits of these kinds:

  • add a check, to this suite only or saved on the request;
  • save a variable from a response ($.access_token as {{access_token}});
  • make a step Setup or Clean up;
  • add a saved request from your collections to the suite.

That's deliberately narrow. It doesn't write new requests, change URLs or edit scripts. Every change is one you could make in the Edit panel yourself.

Good prompts

  • "Save the token from Log in and use it in every request after it."
  • "Add checks from the last responses: status, content type and the main fields."
  • "Mark Create test customer as setup and Delete test customer as clean up."
  • "The last run failed on Get invoice. Add checks that would show why."
  • "Add the requests from the Billing folder that aren't in the suite yet."

The last run (statuses, failed checks and the start of each response) is part of what the model sees, so prompts about failures work best right after a run.

Review, then save

Each proposed change has a reason, for example "the login response has $.access_token; three later requests send Authorization: Bearer {{token}}, which isn't set". Go through them:

  • Keep applies one to the suite in the editor.
  • Skip drops it.
  • Keep all applies the rest.

Kept changes are ordinary edits, so press Save in the header to keep them, or close without saving. One exception: checks saved on the request go to Collections right away, because they belong to the request, not to the suite.

The server also checks every change before you see it. A change that names a request or step that isn't in the suite, or a check type that doesn't exist, is left out and listed under the changes, so you know the model tried.

What is sent

  • The suite: its steps, checks and saved variables.
  • The last run: statuses, failed checks and the beginning of each response.
  • Not sent: tokens, passwords, keys and fields that look like secrets. They're removed first.

Cloud, local or hybrid

ModeWhere the model runs
CloudThe model your Requestarium server is set up with.
LocalA model on your computer, through Ollama, LM Studio or another OpenAI-compatible server.
HybridWorks like Cloud for suites.

Local keeps the suite and the response snippets on your machine. In the browser, the local server must allow the page's origin; for Ollama that's the OLLAMA_ORIGINS setting.

Treat it like a pull request from a colleague

The model is good at the mechanical parts: wiring a token through ten steps, turning field names into checks. It's weaker at knowing which values matter to your business. Keep the mechanical changes, read the checks it proposes, and change "$.status exists" into "$.status equals paid" where you know the answer.