Bitcoind When sending a payment how can I know how many inputs and outputs there are?
When you use bitcoind's internal wallet and its related RPCs, it will automatically calculate the transaction fee for you and include that in the transaction. You can then retrieve the transaction fee used by using the gettransaction command. If you want the fee rate that was used, you can use the fee from gettransaction and divide that by the size returned by gettransaction.

Edit: To get the fee before you send, you can create the transaction with only the outputs you want (i.e. no inputs) with createrawtransaction. Then you can use fundrawtransaction to fill out the transaction with inputs. That will also give you the fee that the transaction is paying. Then you sign it with signrawtransaction and send it with sendrawtransaction. There is no other way as the other send* RPCs create the transaction, select coins, sign, and send all in one command.