api-test-generator

Generate pytest integration tests for REST and GraphQL APIs with auth validation and error handling.

25|2|Updated Oct 26, 2025
One-click install
npx skills add https://github.com/matteocervelli/llms --skill api-test-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-test-generator
Source: https://github.com/matteocervelli/llms/tree/main/.claude/skills/api-test-generator
Command: npx skills add https://github.com/matteocervelli/llms --skill api-test-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill creates integration tests for API endpoints, covering REST/GraphQL, auth, validation, and error handling.

Core Features & Use Cases

  • Endpoint Coverage: Tests for all HTTP methods and status codes.
  • Auth/Validation: Validate authentication/authorization and request payloads.
  • Response Validation: Assert response schemas and error handling paths.

Quick Start

Generate a test suite for a REST API endpoint with authentication requirements.

Frequently Asked Questions about api-test-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate comprehensive tests for REST and GraphQL API endpoints?

Generate comprehensive API endpoint tests by defining your endpoints and authentication requirements. The Skill performs endpoint discovery, maps routes, and scaffolds pytest test suites covering authentication, authorization, request/response validation, and error handling across success cases and common HTTP status codes like 200, 201, 400, 422, 401, 403, 404, 409, and 500.

Can I validate both request bodies and response schemas automatically?

Yes. The Skill validates request payloads and asserts response schemas as part of test generation. It covers validation errors and ensures your API tests confirm both incoming request structure and outgoing response format align with your endpoint specifications.

What HTTP methods and error cases does API test generation cover?

API test generation covers all HTTP methods and comprehensive error scenarios. Tests include authentication/authorization flows, validation error responses, and standard HTTP status codes: 200, 201, 204, 400, 422, 401, 403, 404, 409, and 500, ensuring both happy paths and failure modes are validated.

Do I need authentication setup before generating endpoint tests?

Authentication setup is part of the test generation process. The Skill creates tests that validate authentication and authorization requirements for your endpoints, so you define auth rules during test scaffolding, and validation tests confirm they work correctly.

What's the difference between testing REST versus GraphQL endpoints?

The Skill generates tests for both REST and GraphQL APIs using the same validation principles. REST tests map HTTP methods and status codes to routes; GraphQL tests validate query/mutation structures and response schemas. Both apply authentication, payload validation, and error handling coverage.

Can I generate tests for endpoints with complex validation rules?

Yes. The Skill performs request body validation during test scaffolding, creating tests that check validation error responses. It generates pytest suites that confirm your endpoints correctly reject invalid payloads and return appropriate HTTP status codes like 400 and 422.