AI in API testing: what works in 2026 and where it goes wrong
Checkcraft is a desktop app for checking APIs and logs without code, with a free edition. Download, no sign-up →
AI is good at drafting API tests from documentation, OpenAPI and curl, and at quickly listing negative cases. It is weak on expectations: it takes them from the actual response, checks only the status code and never looks at logs or the database. The setup that works: AI drafts the checks, expectations come from the requirements, the run is the same every time, and a person makes the call.
What does AI already do well in API testing?
It drafts test cases from documentation, an OpenAPI spec, a curl example or a screenshot of a response. It suggests negative cases such as an empty field, an extra field, a wrong type, boundary values or someone else’s token. It generates test data and repeats similar checks across dozens of endpoints. This takes minutes instead of hours, and this is where AI pays off.
Where does AI go wrong in tests most often?
It takes expected values from what the server already returned, so the test locks the bug in instead of catching it. It checks status 200 and that fields exist, but not the total, not how fields relate, and not whether the request reached the next service. An agent may “fix” a failing test by adjusting the expectation to the response, or rewrite an older test to agree with its own bug. And it cannot see logs or the database unless you give it access. The test is green and cannot fail.
How do you check that AI-written tests test anything?
Feed the test a deliberately wrong response: a different total, a status with a typo, an extra field. If the test stays green, it checks nothing. Mutation testing does the same for code: small faults are injected and you count how many the tests missed, and surviving mutants are a more honest number than coverage. Keep expectations in the requirements, apart from the server response, and do not let the agent change them.
How do you pair an AI agent with a reliable run?
Split the roles. An agent such as Claude Code or Cursor creates checks on request, and a program runs them the same way every time. Checkcraft for Windows 1.0.185 and later has an MCP server, and the free version is enough. The agent creates a test case that checks the API response, the Kibana log records for the traceId and the database row (database in Pro) in one go, and runs it. Access is off by default, calls are accepted only from your computer, and any agent edit can be undone. Without an agent, the built-in local AI drafts the checks.
Here are the requirements for POST /orders (paste the text or OpenAPI).
Create a test case in Checkcraft: status 201, total = sum of items minus discount,
status = "CREATED", no ERROR in the payments service log for this traceId.
Take expected values only from the requirements, never from the actual response.
Run it and show which checks failed.How can you try it in 10 minutes?
Take the practice API where every response comes back with 200 and 10 bugs hide inside. Ask your AI to write tests for it and count how many bugs they catch. Tests that check only the status and that fields exist miss almost all of them. Then find the bugs yourself and get into the hall of fame.
Repeat this on your own API
Checkcraft is a desktop app that saves API response checks without code and shows what did not match. Start with a sample, then use your own sanitized data. Free runs on Windows and Linux with no time limit.
Download FreeDownload and first runNo sign-up or email needed, the archive is ready in a couple of minutes. See the edition limits.
References
Model Context Protocol · OpenAPI Specification · Stryker: mutation testing
Start with the linked example and compare its result with your own test requirement.