{
  "openapi": "3.0.0",
  "info": {
    "title": "CapabilityBase API",
    "version": "1.0.0"
  },
  "paths": {
    "base64.convert": {
      "summary": "Base64 Converter",
      "description": "Text Base64 encode/decode plus image-to-DataURI conversion. All local.",
      "parameters": [
        {
          "name": "mode",
          "in": "body",
          "schema": {
            "type": "string",
            "enum": [
              "encode",
              "decode"
            ]
          },
          "required": true
        },
        {
          "name": "data",
          "in": "body",
          "schema": {
            "type": "string"
          },
          "required": true
        }
      ],
      "responses": {
        "200": {
          "description": "Success",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "result": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "case.convert": {
      "summary": "Case Converter",
      "description": "Convert between camelCase, snake_case, PascalCase, kebab-case, and more.",
      "parameters": [
        {
          "name": "input",
          "in": "body",
          "schema": {
            "type": "string",
            "description": "Text or identifier to convert"
          },
          "required": true
        }
      ],
      "responses": {
        "200": {
          "description": "Success",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "camel": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "pascal": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "snake": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "kebab": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "constant": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "dot": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "path": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "train": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "gen.lorem": {
      "summary": "Lorem Ipsum",
      "description": "Generate placeholder text in multiple languages and styles.",
      "parameters": [
        {
          "name": "unit",
          "in": "body",
          "schema": {
            "type": "string",
            "enum": [
              "paragraphs",
              "words",
              "chars"
            ]
          },
          "required": false
        },
        {
          "name": "amount",
          "in": "body",
          "schema": {
            "type": "number"
          },
          "required": false
        },
        {
          "name": "options",
          "in": "body",
          "schema": {
            "type": "object"
          },
          "required": false
        }
      ],
      "responses": {
        "200": {
          "description": "Success",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "result": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "gen.password": {
      "summary": "Password Generator",
      "description": "Cryptographically secure random password generator.",
      "parameters": [
        {
          "name": "length",
          "in": "body",
          "schema": {
            "type": "number",
            "minimum": 1,
            "maximum": 256
          },
          "required": false
        },
        {
          "name": "options",
          "in": "body",
          "schema": {
            "type": "object"
          },
          "required": false
        }
      ],
      "responses": {
        "200": {
          "description": "Success",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "password": {
                    "type": "string"
                  },
                  "strength": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "json.repair": {
      "summary": "JSON Repair",
      "description": "Fix broken JSON from AI output — comments, trailing commas, unquoted keys, bracket balancing.",
      "parameters": [
        {
          "name": "input",
          "in": "body",
          "schema": {
            "type": "string",
            "description": "Broken or malformed JSON string"
          },
          "required": true
        }
      ],
      "responses": {
        "200": {
          "description": "Success",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "fixed": {
                    "type": "string",
                    "description": "Repaired JSON string"
                  },
                  "fixes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "valid": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "text.dedup": {
      "summary": "Deduplicate",
      "description": "Remove duplicate lines while preserving order.",
      "parameters": [
        {
          "name": "lines",
          "in": "body",
          "schema": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "required": false
        },
        {
          "name": "options",
          "in": "body",
          "schema": {
            "type": "object"
          },
          "required": false
        }
      ],
      "responses": {
        "200": {
          "description": "Success",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "total": {
                    "type": "number"
                  },
                  "unique": {
                    "type": "number"
                  },
                  "removed": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      }
    },
    "text.sort": {
      "summary": "Sort Lines",
      "description": "Alphabetical, numeric, and reverse line sorting with deduplication option.",
      "parameters": [
        {
          "name": "lines",
          "in": "body",
          "schema": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "required": false
        },
        {
          "name": "method",
          "in": "body",
          "schema": {
            "type": "string",
            "enum": [
              "alpha",
              "numeric",
              "length",
              "reverse",
              "random"
            ]
          },
          "required": false
        },
        {
          "name": "order",
          "in": "body",
          "schema": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          },
          "required": false
        },
        {
          "name": "options",
          "in": "body",
          "schema": {
            "type": "object"
          },
          "required": false
        }
      ],
      "responses": {
        "200": {
          "description": "Success",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lines": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "token.counter": {
      "summary": "Token Counter",
      "description": "Estimate tokens, count words/chars, calculate API costs across GPT-4o, Claude, Gemini.",
      "parameters": [
        {
          "name": "input",
          "in": "body",
          "schema": {
            "type": "string",
            "description": "Text to analyze"
          },
          "required": true
        }
      ],
      "responses": {
        "200": {
          "description": "Success",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tokens": {
                    "type": "number"
                  },
                  "words": {
                    "type": "number"
                  },
                  "characters": {
                    "type": "number"
                  },
                  "charactersNoSpace": {
                    "type": "number"
                  },
                  "sentences": {
                    "type": "number"
                  },
                  "paragraphs": {
                    "type": "number"
                  },
                  "readingTime": {
                    "type": "string"
                  },
                  "speakingTime": {
                    "type": "string"
                  },
                  "avgWordLength": {
                    "type": "number"
                  },
                  "cost": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "url.encode": {
      "summary": "URL Encode/Decode",
      "description": "Percent-encoding and decoding for URLs and query strings.",
      "parameters": [
        {
          "name": "mode",
          "in": "body",
          "schema": {
            "type": "string",
            "enum": [
              "encode",
              "decode"
            ]
          },
          "required": true
        },
        {
          "name": "data",
          "in": "body",
          "schema": {
            "type": "string"
          },
          "required": true
        }
      ],
      "responses": {
        "200": {
          "description": "Success",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "result": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}