{
  "openapi": "3.1.0",
  "info": {
    "title": "NEAR Protocol RPC: Node Metrics",
    "description": "Retrieve performance metrics and statistics from a NEAR Protocol node",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://rpc.mainnet.fastnear.com",
      "description": "Mainnet"
    },
    {
      "url": "https://rpc.testnet.fastnear.com",
      "description": "Testnet"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    },
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/metrics": {
      "get": {
        "operationId": "metrics",
        "summary": "Get node metrics",
        "description": "Retrieves Prometheus-format node metrics from the HTTP `/metrics` endpoint. Requires an API key.",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "Prometheus exposition text",
                  "example": "# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.\n# TYPE process_cpu_seconds_total counter\nprocess_cpu_seconds_total 12.34"
                }
              }
            }
          },
          "403": {
            "description": "Missing or invalid API key",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "example": "Forbidden"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "FastNEAR API key as an `Authorization: Bearer` header. Preferred for backends, workers, and proxies because it keeps the key out of URLs and logs."
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "apiKey",
        "description": "FastNEAR API key as the `apiKey` query parameter. Handy for curl or clients that cannot set headers, but the key can end up in URLs, logs, and shell history."
      }
    }
  }
}
