Store API keys and other secrets encrypted in your database and use them from SQL.
Enable vault under Database → Extensions in Studio, then add secrets in Studio (Integrations → Vault) or with SQL:
SQL
select vault.create_secret('sk_live_123', 'stripe_key', 'Stripe secret key');
select decrypted_secret from vault.decrypted_secrets where name = 'stripe_key';
select vault.update_secret((select id from vault.secrets where name = 'stripe_key'), 'sk_live_456');
delete from vault.secrets where name = 'stripe_key';Values are stored encrypted with AES-256 in vault.secrets; each project has its own key, kept by the platform and not readable from SQL. Only your project role can read vault.decrypted_secrets, so never grant it to anon or authenticated. In Studio, secret values stay hidden until you reveal one.