In the current Assistants docs, there’s no mention of how to use the API key. In case you’re wondering, here’s how to do it in NodeJS:
- Put the key into a .env file like this:
OPENAI_API_KEY=<key goes here>
- Pass it as an argument to the
OpenAI
constructor:
require('dotenv').config();
const OpenAI = require('openai');
const openai = new OpenAI({ apiKey: `${process.env.OPENAI_API_KEY}`});