{
  "openapi": "3.0.0",
  "info": {
    "title": "ToolPilot Developer Tools API",
    "version": "1.0.0",
    "description": "Conceptual function reference for all 20 ToolPilot developer tools. These tools run client-side only — this spec describes the algorithmic operations as callable functions for use in Python, JavaScript, and shell environments. See https://toolpilot.dev/api/ for code samples.",
    "contact": {
      "name": "ToolPilot",
      "url": "https://toolpilot.dev",
      "email": "hello@toolpilot.dev"
    },
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "paths": {
    "/tools/json-formatter": {
      "post": {
        "summary": "Format or minify a JSON string",
        "operationId": "formatJson",
        "tags": ["Data Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["json_string"],
                "properties": {
                  "json_string": { "type": "string", "description": "Raw JSON string to format" },
                  "indent": { "type": "integer", "default": 2, "description": "Spaces for indentation (0 = minify)" },
                  "sort_keys": { "type": "boolean", "default": false, "description": "Sort object keys alphabetically" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Formatted or minified JSON string",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "string" } } } } }
          }
        }
      }
    },
    "/tools/base64-encoder": {
      "post": {
        "summary": "Encode or decode a Base64 string",
        "operationId": "base64",
        "tags": ["Encoding Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["text"],
                "properties": {
                  "text": { "type": "string", "description": "Input string to encode or decode" },
                  "mode": { "type": "string", "enum": ["encode", "decode"], "default": "encode" },
                  "url_safe": { "type": "boolean", "default": false }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Base64-encoded or decoded string",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "string" } } } } }
          }
        }
      }
    },
    "/tools/url-encoder": {
      "post": {
        "summary": "Percent-encode or decode a URL string",
        "operationId": "urlEncode",
        "tags": ["Encoding Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["text"],
                "properties": {
                  "text": { "type": "string" },
                  "mode": { "type": "string", "enum": ["encode", "decode"], "default": "encode" },
                  "safe": { "type": "string", "default": "" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "URL-encoded or decoded string",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "string" } } } } }
          }
        }
      }
    },
    "/tools/uuid-generator": {
      "post": {
        "summary": "Generate a UUID",
        "operationId": "generateUUID",
        "tags": ["Generator Tools"],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": { "type": "integer", "enum": [1, 4, 5], "default": 4 },
                  "count": { "type": "integer", "default": 1, "maximum": 100 }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated UUID(s)",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "uuids": { "type": "array", "items": { "type": "string", "format": "uuid" } } } } } }
          }
        }
      }
    },
    "/tools/hash-generator": {
      "post": {
        "summary": "Hash a string using MD5, SHA-1, SHA-256, or SHA-512",
        "operationId": "hashText",
        "tags": ["Security Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["text"],
                "properties": {
                  "text": { "type": "string" },
                  "algorithm": { "type": "string", "enum": ["md5", "sha1", "sha256", "sha512"], "default": "sha256" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Hash digest",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "hash": { "type": "string" }, "algorithm": { "type": "string" } } } } }
          }
        }
      }
    },
    "/tools/word-counter": {
      "post": {
        "summary": "Count words, characters, and estimate reading time",
        "operationId": "countWords",
        "tags": ["Text Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["text"],
                "properties": {
                  "text": { "type": "string" },
                  "reading_wpm": { "type": "integer", "default": 200 }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Text statistics",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "word_count": { "type": "integer" }, "char_count": { "type": "integer" }, "sentence_count": { "type": "integer" }, "reading_time_minutes": { "type": "number" } } } } }
          }
        }
      }
    },
    "/tools/password-generator": {
      "post": {
        "summary": "Generate a cryptographically secure random password",
        "operationId": "generatePassword",
        "tags": ["Security Tools"],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "length": { "type": "integer", "default": 16, "minimum": 4, "maximum": 128 },
                  "use_uppercase": { "type": "boolean", "default": true },
                  "use_lowercase": { "type": "boolean", "default": true },
                  "use_digits": { "type": "boolean", "default": true },
                  "use_symbols": { "type": "boolean", "default": true }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated password",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "password": { "type": "string" }, "strength": { "type": "string" } } } } }
          }
        }
      }
    },
    "/tools/timestamp-converter": {
      "post": {
        "summary": "Convert a Unix timestamp to a human-readable date",
        "operationId": "convertTimestamp",
        "tags": ["Utility Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["timestamp"],
                "properties": {
                  "timestamp": { "type": "integer", "description": "Unix timestamp in seconds or milliseconds" },
                  "timezone": { "type": "string", "default": "UTC" },
                  "format": { "type": "string", "default": "iso8601" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Formatted date information",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "iso8601": { "type": "string" }, "human_readable": { "type": "string" }, "day_of_week": { "type": "string" }, "relative_time": { "type": "string" } } } } }
          }
        }
      }
    },
    "/tools/html-entity-encoder": {
      "post": {
        "summary": "Encode or decode HTML entities",
        "operationId": "htmlEntities",
        "tags": ["Encoding Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["text"],
                "properties": {
                  "text": { "type": "string" },
                  "mode": { "type": "string", "enum": ["encode", "decode"], "default": "encode" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "HTML-encoded or decoded string",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "string" } } } } }
          }
        }
      }
    },
    "/tools/json-to-csv": {
      "post": {
        "summary": "Convert a JSON array of objects to CSV",
        "operationId": "jsonToCSV",
        "tags": ["Data Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["json_string"],
                "properties": {
                  "json_string": { "type": "string", "description": "JSON array of objects" },
                  "delimiter": { "type": "string", "default": ",", "maxLength": 1 }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CSV-formatted string",
            "content": { "text/csv": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/tools/text-case-converter": {
      "post": {
        "summary": "Convert text between naming conventions",
        "operationId": "convertCase",
        "tags": ["Text Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["text", "to_case"],
                "properties": {
                  "text": { "type": "string" },
                  "to_case": { "type": "string", "enum": ["snake", "camel", "pascal", "kebab", "constant", "title", "upper", "lower"] }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Converted string",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "result": { "type": "string" } } } } }
          }
        }
      }
    },
    "/tools/jwt-decoder": {
      "post": {
        "summary": "Decode a JWT token",
        "operationId": "decodeJWT",
        "tags": ["Security Tools"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["token"],
                "properties": {
                  "token": { "type": "string", "description": "JWT token string" },
                  "verify": { "type": "boolean", "default": false },
                  "secret": { "type": "string", "description": "Secret key for verification" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decoded JWT",
            "content": { "application/json": { "schema": { "type": "object", "properties": { "header": { "type": "object" }, "payload": { "type": "object" }, "is_expired": { "type": "boolean" } } } } }
          }
        }
      }
    }
  },
  "tags": [
    { "name": "Data Tools", "description": "JSON formatting, CSV conversion, and data transformation" },
    { "name": "Encoding Tools", "description": "Base64, URL encoding, HTML entities" },
    { "name": "Security Tools", "description": "Hashing, password generation, JWT decoding" },
    { "name": "Generator Tools", "description": "UUID, Lorem Ipsum, QR codes" },
    { "name": "Text Tools", "description": "Word counting, case conversion, diff checking" },
    { "name": "Utility Tools", "description": "Timestamp conversion, color conversion, regex testing" }
  ]
}
