Is the organization parameter compulsory while instantiating the OpenAI object in nodejs?

Can I instantiate the OpenAI object by only using the API Key and not the organization parameter in my NodeJs application as below?

import { Configuration, OpenAIApi } from "openai";
const configuration = new Configuration({
        apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
const response = await openai.listEngines();

Welcome to the forum!

It’s an optional parameter, but useful if you want to track usage per organisation from the account page.

2 Likes