I’m building a kinda compilation of several differents stuffs that I use regularly that I’m making into a more user freindlier format. I’m having difficulty integrating AI into the page and specifically making the openai api call tho.
On the site, a user (me) will enter their meals, and the app will send the input to OpenAI’s API (ChatGPT) to get calorie and protein estimates, which are then displayed back on the page.
But, the API call isn’t working, I think maybe I am having multiple issues and I’m curious if anyone else has a way through this or a potential workaround?
When I submit the form on the meals page I get the response: “Failed to process meal: AI service not available”…
I’m using a free Glitch account.
The site is: Honrai No Menmoku: https://honrai-no-menmoku.glitch.me/
The OpenAI API key is stored in .env.
Running: node 16.14.2 and openai 4.87.3
Happy to share code if it is helpful.
How can I correctly configure Glitch to handle OpenAI API calls securely?
I really enjoy coding and building little apps to help with training… I built several small apps to help with gym/martial arts stuffs that I find super helpful.
I’m kinda noob at coding, so any insights from the community here would be greatly appreciated. Thanks in advance!