Secrets and settings
Adding a secret
A secret is a token, password or API key your project uses to reach another service. This page shows how to add one, replace it and delete it. You always paste the value in the BitHut cabinet, never in the chat.
With a link from your AI
This is the usual way. When the code needs a key, your AI tells you its name and gives you a link like https://app.bithut.app/p/my-bot/secrets/new?key=TELEGRAM_BOT_TOKEN.
- Get the value from the service that issues it, for example from BotFather for a Telegram bot.
- Open the link. The page says “Your AI asked for
TELEGRAM_BOT_TOKEN”, and the name is already filled in. - Paste the value into Value and press Save.
- Tell your AI it is done. It can check that the name is saved, but it never sees the value.
Without a link
- Open the project and the Keys tab.
- Press Add a key or password.
- Write the Name the code reads. It uses capital letters, digits and underscores, like
OPENAI_API_KEY. Your AI tells you which name the code expects. - Paste the Value and press Save.
Add a key yourself only when your AI asked for it, or when you know the exact name the code reads.
What happens after saving
- A running project restarts with the new key, in a few seconds.
- A paused project gets it when you resume it.
- A project that was not deployed yet gets it on its first deploy.
Saved values are never shown again, not in the cabinet, not to your AI, not to you. The Keys tab lists only the names, marked “saved, hidden”.
Replacing a key
Add it again with the same name. The new value replaces the old one, and the project restarts with it. If your AI gives you a link for a key that is already saved, the link replaces it too.
Replace a key at once at the service that issued it if it leaked, for example if it was written in a chat or in the code. Then save the new value in BitHut.
Deleting a key
On the Keys tab, press Delete next to the name and confirm. The project restarts without it.
Names BitHut sets itself
PORT, DATA_DIR and BITHUT_POOL are set by BitHut and cannot be saved as keys. See Moving a .env file.
A name that starts with VITE_, NEXT_PUBLIC_ or another public prefix is saved as a public build setting, not a secret. See Public build settings.