(AI) openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.
โ๏ธ์์ ๋ด์ฉ (OpenAI API ํ ์คํธ) 1. API Key ์์ฑ 2. ํ๊ฒฝ๋ณ์ ์ค์
setx OPENAI_API_KEY "your_api_key_here"
3. OpenAI API ์ค์น
pip install openaiโ
4. ์์ค ์ฝ๋ ์์ฑ (text_example.py)
from openai import OpenAI
client = OpenAI()
completion = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{
"role": "user",
"content": "Write a haiku about recursion in programming."
}
]
)
print(completion.choices[0].message)โ
5. ์คํ
python text_example.py .โ
6. ์๋ฌ ๋ฐ์
openai.error.RateLimitError: You exceeded your current quota,
please check your plan and billing details. For more information on this error,
read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.