0

I'm trying to generate academic papers using OpenAI's API in Google Colab. However, I'm encountering a RateLimitError that says "You exceeded your current quota, please check your plan and billing details." Here's the code I'm using:

!pip install openai
# Import the necessary libraries and set up the API key
import openai

openai.api_key = "your_openai_api_key"

# Define the prompts
prompts = [
"List"# List of prompts for generating academic papers
]

# Function to generate an academic paper
def generate_academic_paper(prompt):
 model_engine = "text-davinci-003"
 max_tokens = 2048

 completion = openai.chat.completions.create(
  model=model_engine,
  messages=[{"role": "system", "content": "You are a helpful assistant."},
           {"role": "user", "content": prompt}],
  max_tokens=max_tokens,
  temperature=0.8,
  top_p=1,
  frequency_penalty=0,
  presence_penalty=0 )
return completion

import time
# Function to generate academic papers for given prompts
def generate_papers(prompts):
  for prompt in prompts:
      response = generate_academic_paper(prompt)
      print(response)
      print("loop")
      time.sleep(2)

# Generate academic papers for the given prompts
generate_papers(prompts)

I've already checked my OpenAI account and I'm sure that I haven't exceeded the quotaas you can see at below:

enter image description here

I've also tried adding a delay between requests using time.sleep(2), but I'm still encountering the error. I've also attached a screenshot of my OpenAI account showing that I haven't exceeded the quota. Any suggestions on how to fix this issue?

1 Answer 1

0

In the picture all your credits are expired. Unfortunatelly you need to add a minimun of 5 dollars to keep useing the api. They will last for a year regardless if you use them all or not

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.