# agent402.tools OpenAPI/Swagger Endpoint Extractor

> agent402.tools OpenAPI/Swagger Endpoint Extractor is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Flattens an OpenAPI 3.x or Swagger 2.x specification into a structured list of callable endpoints, one row per operation with method, path, operationId, parameters, and response codes.

## Facts

- Endpoint: POST https://agent402.tools/api/openapi-extract
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-openapi-swagger-endpoint-extractor-5d089bfd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9FIQtswpCTCawEAAnPHQu

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent402-tools-openapi-swagger-endpoint-extractor-5d089bfd -d '<json body>'
```

Example prompt: Can you parse this OpenAPI spec I'm pasting and give me a flat list of every endpoint — including the HTTP method, path, operationId, parameters, and response codes for each operation?

## When to prefer this

Use this endpoint when you need to programmatically introspect an OpenAPI or Swagger specification and want a flat, tabular representation of all operations — ideal for building API catalogs, agent tool registries, or automated documentation workflows. Prefer this over manual parsing when you need parameter-level detail including types, required flags, and response codes in a single structured response.

## Known failure modes

- Invalid or malformed OpenAPI/Swagger document returns a parse error
- Spec passed as a non-object and non-JSON string may be rejected
- Unsupported spec version (e.g. OpenAPI 1.x) may not be parsed correctly
- Very large specs may time out or exceed payload limits
- Missing required 'spec' field returns a validation error

## How this service works

Flatten an OpenAPI 3.x or Swagger 2.x spec into a structured list of callable endpoints - one row per operation with method, path, operationId, summary, tags, parameters (name / in / required / type), JSON-body flag, and documented response codes. Includes per-method and per-tag counts so an agent can pick what to call next without parsing the full spec. Output is sorted by path then method for stable, agent-friendly grouping. Pure CPU - deterministic, no network, no $ref dereferencing.

## Output

A structured list of endpoint rows, one per API operation, each containing the HTTP method, URL path, operationId, summary, tags, parameter details (name, location, required flag, type), whether a JSON body is expected, and documented response codes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "spec": {
   "description": "OpenAPI/Swagger document (object or JSON string)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "stats": {
   "byTag": {
    "users": 2
   },
   "total": 2,
   "byMethod": {
    "GET": 1,
    "DELETE": 1
   }
  },
  "endpoints": [
   {
    "path": "/users",
    "tags": [
     "users"
    ],
    "method": "GET",
    "params": [
     {
      "in": "query",
      "name": "limit",
      "type": "integer",
      "required": false
     }
    ],
    "summary": "List users",
    "responses": [
     "200",
     "400"
    ],
    "hasJsonBody": false,
    "operationId": "listUsers"
   },
   {
    "path": "/users/{id}",
    "tags": [
     "users"
    ],
    "method": "DELETE",
    "params": [
     {
      "in": "path",
      "name": "id",
      "type": "string",
      "required": true
     }
    ],
    "summary": "Delete user",
    "responses": [
     "204"
    ],
    "hasJsonBody": false,
    "operationId": "deleteUser"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-openapi-swagger-endpoint-extractor-5d089bfd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
