You’d have to somehow determine the smart contracts input data types and create multiple endpoint functions mapped to each smart contract method you want to use – maybe determining whether a smart contract function is of an “external” or “public” type or not by the API as a signal that the has for this function should be paid for – and then work some middleware magic that takes the abi of the smart contract and maps an api method to each function with the right inputs and data types. Easier written than done though lol.