Closed kiritowu closed 1 year ago
According to this (js) and this (py) example, the only authentication to call openai's API is just the apiKey
.
import { Configuration, OpenAIApi } from "openai";
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
import openai
openai.api_key = "sk-..."
# list engines
engines = openai.Engine.list()
# print the first engine's id
print(engines.data[0].id)
# create a completion
completion = openai.Completion.create(engine="ada", prompt="Hello world")
# print the completion
print(completion.choices[0].text)
There are two options available and the attached are the pros & cons:
APIKey
:
APIKey
:
Use Python Backend for APIKey
.
To-Dos: