The fee amount is simply the difference between Total Inputs and Total Outputs... so when you are creating the transaction, you just factor that in. If you're wanting to use the "Dynamic Fee" system, you'd call the "estimatefee" function (with appropriate parameter(s)) and that would give you the fee (in btc/KB) to use... then you select inputs where total inputAmount >= (requestedAmount + estimated fee)...
Then, create outputs to be:
amountToCustAddr = withdrawAmount = (requestedAmount - fee)
amountToChangeAddress = (Total inputs - requestedAmount)
So:
estimatefee(6 blocks) = 0.00256843 btc/kB
requestedAmount = 0.01
AvailableInput1 = 3.4 BTC
Assuming tx size of 226 bytes (1 input + 1 custAddr Output + 1 changeAddr output), the fee = (0.00256843 BTC/kB / 1000) * 226 bytes = 0.00058047
withdrawAmount = (requestedAmount - fee) = 0.01 - 0.00058047 = 0.00941953 BTC
amountToChangeAddr = (TotalInputs - requestedAmount) = 3.4 - 0.01 = 3.39 BTC
Then just create a transaction with all the calculated values:
Inputs:
AvailableInput1 = 3.4 BTC
Outputs:
custAddr = withdrawAmount = 0.00941953 BTC
chgAddr = (TotalInputs - requesteedAmount) = 3.4 - 0.01 = 3.39 BTC
The fee is not explicitly specified when you create the transaction, as the protocol specifies that it is the difference between total Inputs (3.4) and total outputs (3.39 + 0.00941953) = 0.00058047 in this example
Just be aware that your customers are likely to moan and whine if they request 0.01 and only get 0.00941953 unless you make it VERY VERY VERY clear that the transaction fee will be deducted from the requested amount