Api tester

From autonomous-ai/autonomous-intern · View interactive version

Api tester is an AI agent skill from the GitHub repository autonomous-ai/autonomous-intern. Tests and validates API endpoints by constructing requests, executing them, and verifying responses. Use when the user says "test this API", "send a request to this endpoint", "generate a curl command", "validate this response", "check if this endpoint works", "debug this API call", "test my REST en

How to use this skill

Skill file

API Tester

Quick Start

Parse the endpoint details, construct test requests covering both happy path and error cases, execute them, and validate responses against expected status codes, schemas, and response times.

Workflow

  1. Extract endpoint details: HTTP method, URL, path/query params, headers, auth scheme, and request body
  2. Build a test matrix: happy path, validation errors (400), auth failures (401), not found (404), and edge cases
  3. Execute each test case, capture the full response (status, headers, body, time), and validate against expectations
  4. Compile results into a structured test report with pass/fail for each case

Examples

Example 1: Test a REST endpoint

Input: "Test GET /api/v1/users/123 with Bearer token"

Output:

## Test Cases

### 1. Happy Path - Get existing user
$ curl -s -w "\nTime: %{time_total}s" \
  -H "Authorization: Bearer $API_TOKEN" \
  https://api.example.com/api/v1/users/123

Status: 200 OK | Time: 0.142s
Body: { "id": "123", "name": "Jane Doe", "email": "jane@example.com" }
Result: PASS

### 2. Auth Failure - No token
$ curl -s https://api.example.com/api/v1/users/123

Status: 401 Unauthorized
Body: { "error": { "code": "UNAUTHORIZED", "message": "Missing auth token" } }
Result: PASS

### 3. Not Found - Non-existent user
$ curl -s -H "Authorization: Bearer $API_TOKEN" \
  https://api.example.com/api/v1/users/999999

Status: 404 Not Found
Body: { "error": { "code": "NOT_FOUND", "message": "User not found" } }
Result: PASS

## Summary
Total: 3 | Passed: 3 | Failed: 0
Avg Response Time: 0.138s

Example 2: Test a POST endpoint with validation

Input: "Test creating a user at POST /api/v1/users"

Output:

## Test Cases

### 1. Happy Path - Valid user creation
$ curl -s -X POST \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"new@example.com","name":"New User"}' \
  https://api.example.com/api/v1/users

Status: 201 Created
Result: PASS

### 2. Validation Error - Missing required field
$ curl -s -X POST \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"No Email User"}' \
  https://api.example.com/api/v1/users

Status: 400 Bad Request
Body: { "error": { "code": "VALIDATION_ERROR", "message": "email is required" } }
Result: PASS

### 3. Duplicate - Existing email
$ curl -s -X POST \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"existing@example.com","name":"Dupe"}' \
  https://api.example.com/api/v1/users

Status: 409 Conflict
Result: PASS

## Summary
Total: 3 | Passed: 3 | Failed: 0

Tools

Error Handling

Connectors (Optional)

This skill works standalone. When connected to external tools, it unlocks additional capabilities:

| Connector | What it enables |

|-----------|----------------|

| ~code repository | Read route definitions and OpenAPI specs directly from the repo |

| ~monitoring | Correlate test results with server-side logs and performance metrics |

| ~documentation | Pull API specs and endpoint documentation to auto-generate test cases |

Rules

Output Template

## Endpoint
[METHOD] [URL]
Auth: [type] | Content-Type: [type]

## Test Cases

### 1. [Test name]
$ curl [command]
Status: [code] [text] | Time: [ms]
Body: [response]
Result: [PASS / FAIL]

### 2. [Test name]
...

## Summary
Total: [N] | Passed: [N] | Failed: [N]
Avg Response Time: [ms]
Schema Validation: [PASS / FAIL]

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.