Way 2: Using Windows Environment Variables (source) STEP 1: Open System properties and select Advanced system settings. STEP 2: Select Environment Variables. STEP 3: Select New. STEP 4: Add your name/key value pair. Variable name: OPENAI_API_KEY. Variable value: sk-xxxxxxxxxxxxxxxxxxxx.
Share, comment, bookmark or report
It doesn't help. In the API usage dashboard, I see 0 API invocation. From API response I am still getting 429"insufficient_quota", even thought I bough quota, regenerated keys, and its been more than 12 hours (so its not propagation delay). –
Share, comment, bookmark or report
import { Configuration, OpenAIApi } from"openai"; ... const configuration = new Configuration({ organization:"YOUR_ORG_ID", apiKey: process.env.OPENAI_API_KEY, }); const openai = new OpenAIApi(configuration); const response = await openai.listEngines(); ... (Additionally, you should note the usage of process.env.<some_key>. Your private keys ...
Share, comment, bookmark or report
If you're satisfied with that, you don't need to specify which model you want. Here's an example of how to use text-embedding-ada-002. import os. from langchain.embeddings.openai import OpenAIEmbeddings. os.environ["OPENAI_API_KEY"] ="sk-xxxx". embeddings = OpenAIEmbeddings()
Share, comment, bookmark or report
I had the same issue. The reason was that I created my API key BEFORE converting my OpenAI account to paid (adding credit card). Doesn't matter if you only upgrade, you also need to create a new api key entirely. I created another API key AFTER I added my credit card and it worked fine!
Share, comment, bookmark or report
If you don't want to use .env file or environment variable to store your API key (for example, in dev environment) - (which is not recommended by the OpenAI's docs!); just pass the API key as a keyword argument when initiating an object from OpenAI class directly: client = OpenAI( api_key="OPENAI_API_KEY", ...
Share, comment, bookmark or report
Option 1 (recommended): Set the OpenAI API key as an environment variable. import os from openai import OpenAI client = OpenAI( api_key = os.environ ...
Share, comment, bookmark or report
I am creating a very simple question and answer app based on documents using llama-index. Previously, I had it working with OpenAI. Now I want to try using no external APIs so I'm trying the Huggin...
Share, comment, bookmark or report
I've stumbled on a similar problem and I've managed to reach OpenAI API. I don't know if it's of any relations, but I've changed in .env.local the alias to NEXT_PUBLIC_OPENAI_KEY because I work with vercel.
Share, comment, bookmark or report
Next, I went to the 'API Keys' section, selected my organization under the 'Default Organizations' dropdown, and saved the changes. This action reset my soft limit, but I still needed to create a new API key to resolve the issue completely. Cancel paid account and recreate with new payment method; Confirm Organization; Create new API Key
Share, comment, bookmark or report
Comments