I am using the following endpoint and my usage is showing and billing for GPT-4 and InstructGPT. Since GPT-4 is expensive, how can I continue to use only GPT 3.5 endpoint?
Where does the javascript run? Who communicates with OpenAI servers?
Are you giving people the API key that they can steal and use themselves to make AI queries using your account?
Are you using an environment variable? Can it be extracted by executable code?
The API key is in a Javascript code that is obfuscated. The javascript runs in a public_html folder in a hosting site (shared hosting). As of now, the API key stands revoked.
are your users determining the modelName field here?
If so they are most likely choosing GPT-4 hence why you are billed. You could have that always set to gpt-3.5-turbo and you would only get charged for 3.5
However, I understand that if I do not specify the model, OpenAI is defaulting to GPT 4.0 since the last few days as older models are being deprecated.
Thanks for the link. Most of my tools are for generating content (for auto-blogging ) - they call other third party APIs to embed images in between content and also give web links calling Bing APIs enabling users to generate a complete article along with internal links. I will probably have to move the API calling code to the server side to be on the safe side.
But if they can see the code calling the API, they can change it. It sounds more like your key(s) leaked, though, and someone is using the most expensive model for free on your dimeā¦
Iād recommend sooner rather than laterā¦ Iād change all the API keys while youāre at it (after you have them stored securely on the serverā¦) Even with obfuscation, itās relatively trivial to find and steal an API key on the public-facing side ā¦ Good luck!
No, I do not. I used to be a programmer a few years back - but in older Client Server technologies. I took ChatGPTs help to code the html and JavaScript to develop the tools with the knowledge of programming I have. I tried different ways to store the API key in a config file and tried to have a proxy and php coding - but since I am on a shared hosting site, I had issues and could not get it to work - hence left the API key in the JavaScript in the public_html folder (but obfuscated) . My tools are free to use and I am not making any money out of it. Thanks.
The issue here is that the API key is not obfuscated once you make the API request, so anyone can see it clear as day in the network logs (which they would do anyways instead of crawling through your javascript code) unless you are sending it your server, which isnāt ideal either.
I was aware about it and paid a small price for it. I am now writing the code needed to move the api keys and all sensitive data to the serverside (php code outside public_html) and hopefully get my tools up and running shortly. Thanks to all of you for your guidance and help.