Getting Started with the OpenAI API and Node.js/JavaScript

Hi @m-a.schenk - that is a very good point and one I need to make clearer. The .replit file is used to create an entry point for the app with a run command for example:

run = "node index.js"

If your .replit file contained the previous command and your index.js file called the API using a key stored as an environment variable - YES the request will use your key.

However, only the file referenced in the run command within the .replit file can be run on a public REPL. So, I would recomend making sure that the run command in the .replit file dosen’t contain code that calls the API (other than when you’re testing), or sign up for a Replit.com paid account that lets you have private repls. I think that is like $7/month.

Thanks again for bringing this up - it’s a very important point and I’m going to clarify that in the post about using replit.

1 Like