How to store user-entered API key and access in server/api

A user inputs their api-key in an input field. I want to store it safely and use it everytime I make calls from a server/api route.
Is there any way to access a global variable on server-side without having to send it in the body of the get request each time?

I have tried useState and pinia store, but I cannot access these in server/api routes
Screenshot_2024-07-30_at_13.24.51.png
Was this page helpful?