{
  "openapi": "3.0.3",
  "info": {
    "title": "BitFusion.IN AI Tools API",
    "description": "Unified API for 104+ browser tools, calculators, network diagnostics, converters, text tools, and cryptographic utilities on BitFusion.IN.",
    "version": "1.0.0",
    "contact": {
      "name": "BitFusion Support",
      "url": "https://bitfusion.in/about",
      "email": "contact@bitfusion.in"
    }
  },
  "servers": [
    {
      "url": "https://bitfusion.in",
      "description": "Production Server"
    },
    {
      "url": "http://localhost",
      "description": "Local Development"
    }
  ],
  "paths": {
    "/api/v1/tools": {
      "get": {
        "summary": "List all tools and categories",
        "description": "Returns the complete catalog of all 104+ tools across 11 categories with metadata, URLs, and execution capabilities.",
        "operationId": "listTools",
        "responses": {
          "200": {
            "description": "Catalog of tools",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolCatalogResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Execute a tool programmatically",
        "description": "Executes calculations, conversions, network diagnostics, text transforms, or cryptographic operations directly on the server.",
        "operationId": "executeTool",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolExecutionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful execution response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolExecutionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters or unknown tool action"
          }
        }
      }
    },
    "/api/v1/execute": {
      "post": {
        "summary": "Direct Tool Execution Alias",
        "description": "Direct alias for POST /api/v1/tools",
        "operationId": "executeToolDirect",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolExecutionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful execution response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolExecutionResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ToolCatalogResponse": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean" },
          "site": { "type": "string" },
          "totalTools": { "type": "integer" },
          "categories": { "type": "object" },
          "llmsDoc": { "type": "string" },
          "openapi": { "type": "string" }
        }
      },
      "ToolExecutionRequest": {
        "type": "object",
        "required": ["action"],
        "properties": {
          "action": {
            "type": "string",
            "description": "Tool identifier to execute (e.g. dns-lookup, percentage, roman-numeral, hash-generator, unit-converter, base-converter, word-counter, position-sizing, etc.)"
          }
        },
        "additionalProperties": true
      },
      "ToolExecutionResponse": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean" },
          "action": { "type": "string" },
          "result": { "type": "object" },
          "timestamp": { "type": "string" }
        }
      }
    }
  }
}
