I presume that the original reason why we placed the key in the config was so that we can use partner's keys for requests. If we will charge for AI powered plugins, then this is no longer necessary. Instead, we can use our own key and pay the bill from partner wallets.
We would need to first check the partner wallet balance.
If there is not enough, then skip the OpenAI API call and throw an error.
If there is, then we continue and either transfer the funds directly from their wallet, or generate a permit and claim immediately.
Once the funds are confirmed to have arrived, we can return the result from the plugin.
I presume that the original reason why we placed the key in the config was so that we can use partner's keys for requests. If we will charge for AI powered plugins, then this is no longer necessary. Instead, we can use our own key and pay the bill from partner wallets.
We would need to first check the partner wallet balance.