81trust / 100

Openapi Search

by OpenAPI operation search in Search & web

x402 APIPassing, checked 3 h ago

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).

POST https://agent402.tools/api/openapi-search

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
201 ms typical, 201 ms slowest 5%
Last check
3 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://agent402.tools/api/openapi-search" \
  -H "content-type: application/json" \
  -d '{"query":"user avatar","spec":{"paths":{"/posts":{"get":{"operationId":"listPosts","responses":{"200":{}},"summary":"List posts","tags":["posts"]}},"/users/{id}":{"get":{"operationId":"getUser","responses":{"200":{}},"summary":"Get a user","tags":["users"]}},"/users/{id}/avatar":{"put":{"operationId":"uploadUserAvatar","responses":{"200":{}},"summary":"Upload user avatar","tags":["users"]}}}}}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.03:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fapi%2Fopenapi-search
const res = await pay("https://agent402.tools/api/openapi-search", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"query":"user avatar","spec":{"paths":{"/posts":{"get":{"operationId":"listPosts","responses":{"200":{}},"summary":"List posts","tags":["posts"]}},"/users/{id}":{"get":{"operationId":"getUser","responses":{"200":{}},"summary":"Get a user","tags":["users"]}},"/users/{id}/avatar":{"put":{"operationId":"uploadUserAvatar","responses":{"200":{}},"summary":"Upload user avatar","tags":["users"]}}}}}),
});
console.log(await res.json());

Example input

{
  "query": "user avatar",
  "spec": {
    "paths": {
      "/posts": {
        "get": {
          "operationId": "listPosts",
          "responses": {
            "200": {}
          },
          "summary": "List posts",
          "tags": [
            "posts"
          ]
        }
      },
      "/users/{id}": {
        "get": {
          "operationId": "getUser",
          "responses": {
            "200": {}
          },
          "summary": "Get a user",
          "tags": [
            "users"
          ]
        }
      },
      "/users/{id}/avatar": {
        "put": {
          "operationId": "uploadUserAvatar",
          "responses": {
            "200": {}
          },
          "summary": "Upload user avatar",
          "tags": [
            "users"
          ]
        }
      }
    }
  }
}

Example output

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

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402201 ms$0.001