Using custom variable in credentials for OpenAI

Is it possible to use custom variables for the OpenAI credentials? I would like to have custom APIs stored in Postgres which I will then retrieve and use as the API for workflows that use the “AI Agent” nodes.

Information on your n8n setup

  • n8n version: 1.41.1
  • Database (default: SQLite): Postgresql
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Ubuntu 22.04

Hi @PowerBoot

I’m afraid but for security reasons, n8n does not support dynamic credential setting as it would be returned in clear-text(not encrypted) and also visible in execution history etc.

Hope this makes sense :innocent:

Ya, makes sense. I was planning for a user to be able to provide their own OpenAI API key and store it securely in the db. I might look at using the n8n API to create credentials.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.