{"id":24076,"date":"2026-11-02T02:37:42","date_gmt":"2026-11-02T02:37:42","guid":{"rendered":"https:\/\/www.hostinger.com\/support\/?p=24076"},"modified":"2026-11-02T02:37:42","modified_gmt":"2026-11-02T02:37:42","slug":"hostinger-ai-builder-how-to-store-api-keys-with-secrets-in-agentic-mode","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/hostinger-ai-builder-how-to-store-api-keys-with-secrets-in-agentic-mode\/","title":{"rendered":"Hostinger AI Builder: How to store API keys with Secrets in agentic mode"},"content":{"rendered":"<p><a data-click-id=\"hgr-post-content-link-hostinger-ai-builder\" href=\"https:\/\/www.hostinger.com\/ai-builder\">Hostinger AI Builder<\/a> Secrets stores API keys and other credentials for agentic mode projects outside your project code and chat history. Add, edit, and delete secrets from the <strong>App menu<\/strong>, give each secret a Test value for the preview and a Live value for your published site, and save keys pasted into the chat as secrets in one click. Keys already in a project&rsquo;s <code>.env<\/code> file move to Secrets automatically.<\/p><h3><strong>Before you start<\/strong><\/h3><ul>\n<li>These steps apply to Hostinger AI Builder agentic mode projects.<\/li>\n<li>Have the API keys you want to store ready, such as your Stripe secret key or OpenAI API key.<\/li>\n<\/ul><h2 id=\"h-what-hostinger-ai-builder-secrets-does\">What Hostinger AI Builder Secrets does<\/h2><p>Hostinger AI Builder Secrets keeps API keys for services like Stripe or OpenAI out of the chat and out of your project files. When you save a key from the chat, the AI works with a reference to the secret, never the raw value.<\/p><p>Each secret has two values:<\/p><ul>\n<li><strong>Test value<\/strong>: used by the preview in the editor.<\/li>\n<li><strong>Live value<\/strong>: used by your published site.<\/li>\n<\/ul><p>This keeps test and production keys separate.<\/p><h2 id=\"h-add-a-secret-in-hostinger-ai-builder\">Add a secret in Hostinger AI Builder<\/h2><p>Add a secret from the <strong>Secrets<\/strong> panel in the Hostinger AI Builder editor.<\/p><ol>\n<li>Open your project in Hostinger AI Builder and go to <strong>App menu &rarr; Secrets<\/strong>.<br>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-24041\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_08-11.png\" alt=\"\" width=\"522\" height=\"856\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_08-11.png 522w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_08-11-183x300.png 183w\" sizes=\"(max-width: 522px) 100vw, 522px\" \/><\/li>\n<li>Click <strong>Add secret<\/strong>.<br>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-24042\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_08-11_1.png\" alt=\"\" width=\"895\" height=\"614\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_08-11_1.png 895w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_08-11_1-300x206.png 300w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_08-11_1-768x527.png 768w\" sizes=\"(max-width: 895px) 100vw, 895px\" \/><\/li>\n<li>Enter the key&rsquo;s name and its <strong>Test value<\/strong>.<\/li>\n<li>Add a <strong>Live value<\/strong> before you publish your website.<\/li>\n<\/ol><p>Use the name your integration expects, such as <code>STRIPE_SECRET_KEY<\/code>. The AI uses this name to find the secret.<\/p><h2 id=\"h-edit-or-delete-a-secret-in-hostinger-ai-builder\">Edit or delete a secret in Hostinger AI Builder<\/h2><p>Edit or delete secrets in the same <strong>Secrets<\/strong> panel.<\/p><ol>\n<li>Go to <strong>App menu &rarr; Secrets<\/strong>.<\/li>\n<li>Edit the <strong>Test value<\/strong> or <strong>Live value<\/strong> of a secret to replace a key, or delete a secret you no longer use.<br>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-24077\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-33.png\" alt=\"\" width=\"878\" height=\"569\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-33.png 878w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-33-300x194.png 300w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-33-768x498.png 768w\" sizes=\"(max-width: 878px) 100vw, 878px\" \/><\/li>\n<\/ol><p>Replace a key by editing the existing secret rather than adding a new one with a different name, so your integration keeps working without changes.<\/p><h2 id=\"h-save-api-keys-from-the-chat-as-secrets\">Save API keys from the chat as secrets<\/h2><p>Hostinger AI Builder protects keys you enter in the chat in two ways: a secure card when the AI asks for a key, and a security warning when you paste a key into a message.<\/p><h3>Enter a key in the Add your API key card<\/h3><p>When Hostinger AI Builder needs a key for an integration, it shows an <strong>Add your API key<\/strong> card in the chat. The card shows the secret name, such as <code>META_API_KEY<\/code>. Paste the value into the <strong>Paste value<\/strong> field, and it&rsquo;s saved as a secret instead of being sent to the chat.<\/p><p><img decoding=\"async\" class=\"alignnone size-full wp-image-24078\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-34.png\" alt=\"\" width=\"464\" height=\"260\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-34.png 464w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-34-300x168.png 300w\" sizes=\"(max-width: 464px) 100vw, 464px\" \/><\/p><h3>Store pasted keys from the security warning<\/h3><p>If you paste a key into your message, such as a Stripe, OpenAI, Anthropic, GitHub, AWS, or Google key, a <strong>Security warning<\/strong> appears before you send it.<\/p><ol>\n<li>Click <strong>Add secrets<\/strong>.<br>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-24079\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-35.png\" alt=\"\" width=\"393\" height=\"176\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-35.png 393w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-35-300x134.png 300w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/li>\n<li>In the <strong>Store secrets securely<\/strong> window, check the name for each value.<\/li>\n<li>Click <strong>Add secrets<\/strong>.<br>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-24080\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-36.png\" alt=\"\" width=\"514\" height=\"368\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-36.png 514w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/11\/2026-11-02_09-36-300x215.png 300w\" sizes=\"(max-width: 514px) 100vw, 514px\" \/><\/li>\n<\/ol><p>The values are removed from your message and kept in Secrets. If a secret with the same name already exists, the window suggests a new name, such as <code>STRIPE_SECRET_KEY_2<\/code>. To replace the existing key instead, edit it in the Secrets panel.<\/p><h2 id=\"h-use-secrets-on-your-published-hostinger-ai-builder-site\">Use secrets on your published Hostinger AI Builder site<\/h2><p>Your published site uses the <strong>Live value<\/strong> of each secret, while the preview keeps using the <strong>Test value<\/strong>. Publishing syncs your secrets to the live site automatically, so you don&rsquo;t need to add them again.<\/p><p>Add a Live value for each secret before you <a data-click-id=\"hgr-post-content-link-publish-your-project\" href=\"https:\/\/www.hostinger.com\/support\/10506149-hostinger-ai-builder-agentic-mode-how-to-publish-your-app\/\">publish your project<\/a>. If a secret has a Test value but no Live value, a warning appears when you publish.<\/p><h2 id=\"h-move-keys-from-a-env-file-to-hostinger-ai-builder-secrets\">Move keys from a .env file to Hostinger AI Builder Secrets<\/h2><p>Keys stored in a project&rsquo;s <code>.env<\/code> file move to Secrets automatically the first time you open the project after Secrets became available. Non-sensitive settings, such as a site name or feature flag, stay in the <code>.env<\/code> file.<\/p><p>Your API keys are now stored in Secrets, separate from your project code and chat history, with test and live values kept apart. To connect a service that uses these keys, see <a data-click-id=\"hgr-post-content-link-how-to-integrate-a-third-party-api-in-agentic-mode\" href=\"https:\/\/www.hostinger.com\/support\/how-to-integrate-a-third-party-api-into-your-hostinger-ai-builder-agentic-mode-website\/\">How to integrate a third-party API in agentic mode<\/a>.<\/p><p><strong>NOTES<\/strong><\/p><ul>\n<li>Exporting a project includes your secret values, so keep exported files private.<\/li>\n<li>To sell subscriptions with stored Stripe keys, see <a data-click-id=\"hgr-post-content-link-how-to-sell-subscriptions-with-stripe-in-agentic-mode\" href=\"https:\/\/www.hostinger.com\/support\/hostinger-ai-builder-agentic-mode-how-to-sell-subscriptions-with-stripe\/\">How to sell subscriptions with Stripe in agentic mode<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Keep API keys and credentials out of your project code and chat history.<\/p>\n","protected":false},"author":594,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[293],"tags":[],"class_list":["post-24076","post","type-post","status-publish","format-standard","hentry","category-ai-builder"],"hreflangs":[],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/24076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/594"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=24076"}],"version-history":[{"count":2,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/24076\/revisions"}],"predecessor-version":[{"id":24082,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/24076\/revisions\/24082"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=24076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=24076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=24076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}