# agent402.tools OpenAPI Search

> agent402.tools OpenAPI Search 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).

Searches operations within an OpenAPI 3.x or Swagger 2.x specification using free-text queries, scoring results by relevance across operationId, path, tags, summary, and description fields

## Facts

- Endpoint: POST https://agent402.tools/api/openapi-search
- 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-search-38a65686
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Z8wybU0byRExCF0YlxLj1

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-search-38a65686 -d '<json body>'
```

Example prompt: Search this OpenAPI spec for operations related to 'authentication' and return up to 5 results — here's the spec: {spec}.

## When to prefer this

Use this endpoint when you have an OpenAPI or Swagger specification document and need to quickly locate relevant operations by keyword or topic without manually reading the entire spec. It is ideal for agent-driven API discovery, dynamic routing decisions, or when building tooling that introspects third-party APIs at runtime.

## Known failure modes

- Invalid or malformed OpenAPI/Swagger document causes parsing failure
- Query returns zero results if no operations match the tokenized query
- Exceeding the max limit of 100 results returns an error or is capped
- Empty or whitespace-only query may return unranked or all results
- Very large specs may time out or hit payload size limits
- Non-JSON string spec that cannot be parsed returns an error

## How this service works

Search operations in an OpenAPI 3.x or Swagger 2.x spec against a free-text query. Tokenizes the query (lowercase, alphanumeric runs), scores each operation by which fields the tokens match - operationId +3, path +3, tags +2, summary +2, description +1 per matched token - and returns ranked results with a `matches` array naming the contributing fields. Sort: score descending, then path ascending for stability. Limit defaults to 10 (max 100).

## Output

A ranked list of up to N matching API operations from the provided spec, each scored by how well tokens from the query matched fields like operationId, path, tags, summary, and description, along with relevant metadata about each matched operation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "spec": {
   "description": "OpenAPI/Swagger document (object or JSON string)"
  },
  "limit": {
   "description": "Maximum results to return (default 10, max 100)"
  },
  "query": {
   "description": "Free-text search query (tokenized lowercase)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "total": 2,
  "results": [
   {
    "path": "/users/{id}/avatar",
    "tags": [
     "users"
    ],
    "score": 18,
    "method": "PUT",
    "matches": [
     "operationId",
     "path",
     "summary",
     "tags"
    ],
    "summary": "Upload user avatar",
    "operationId": "uploadUserAvatar"
   },
   {
    "path": "/users/{id}",
    "tags": [
     "users"
    ],
    "score": 10,
    "method": "GET",
    "matches": [
     "operationId",
     "path",
     "summary",
     "tags"
    ],
    "summary": "Get a user",
    "operationId": "getUser"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-openapi-search-38a65686/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)
