AI and LLMs · Junior · Question 27 of 75

Where should the API key for an LLM provider live in a web app?

Show the answer

Correct answer: On the server, never in frontend code

Explanation

Anything shipped to the browser can be read. A leaked key lets anyone run requests on your bill. The frontend calls your own backend instead.

Further reading

Problem with a question

AI and LLMs · Junior · question 27

Test yourself

Take the AI and LLMs · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz