Creating a Salesforce Named Credential (for OpenAI etc.)

You can embed your OpenAI API key directly into your demos, although that’s a very bad idea. A good idea is to create a Salesforce named credential to securely hold your API key. My examples often assume you have one named OpenAI.

The process of creating one is unfortunately a bit involved (but at least once it’s done you don’t have to revisit it). The instructions took up an entire post, which can be found here: