Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (seongtaejeong at gmail.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

OpenAI - The API request of HOST_AGENT failed: OpenAI API request exceeded rate limit: Error code: 429

OpenAI API 키 사용 시 이런 오류가 발생한다면?

Round 1, Step 1, HostAgent: Analyzing the user intent and decomposing the request...
The API request of HOST_AGENT failed: OpenAI API request exceeded rate limit: Error code: 429 - {'error': {'message': '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.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}.
Switching to use the backup engine...
Error Occurs at get_response
Traceback (most recent call last):
  File "D:\temp\UFO\ufo\llm\openai.py", line 89, in _chat_completion
    response: Any = self.client.chat.completions.create(
  File "%USERPROFILE%\AppData\Local\Programs\Python\Python310\lib\site-packages\openai\_utils\_utils.py", line 279, in wrapper
    return func(*args, **kwargs)
  File "%USERPROFILE%\AppData\Local\Programs\Python\Python310\lib\site-packages\openai\resources\chat\completions\completions.py", line 914, in create
    return self._post(
  File "%USERPROFILE%\AppData\Local\Programs\Python\Python310\lib\site-packages\openai\_base_client.py", line 1242, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
  File "%USERPROFILE%\AppData\Local\Programs\Python\Python310\lib\site-packages\openai\_base_client.py", line 919, in request
    return self._request(
  File "%USERPROFILE%\AppData\Local\Programs\Python\Python310\lib\site-packages\openai\_base_client.py", line 1023, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\temp\UFO\ufo\agents\processors\basic.py", line 192, in wrapper
    func(self, *args, **kwargs)
  File "D:\temp\UFO\ufo\agents\processors\basic.py", line 174, in wrapper
    result = func(self, *args, **kwargs)
  File "D:\temp\UFO\ufo\agents\processors\host_agent_processor.py", line 189, in get_response
    self._response, self.cost = self.host_agent.get_response(
  File "D:\temp\UFO\ufo\agents\agent\basic.py", line 164, in get_response
    response_string, cost = llm_call.get_completion(
  File "D:\temp\UFO\ufo\llm\llm_call.py", line 25, in get_completion
    responses, cost = get_completions(
  File "D:\temp\UFO\ufo\llm\llm_call.py", line 85, in get_completions
    return get_completions(
  File "D:\temp\UFO\ufo\llm\llm_call.py", line 89, in get_completions
    raise e
  File "D:\temp\UFO\ufo\llm\llm_call.py", line 75, in get_completions
    response, cost = service(configs, agent_type=agent_type).chat_completion(
  File "D:\temp\UFO\ufo\llm\openai.py", line 478, in chat_completion
    return super()._chat_completion(
  File "D:\temp\UFO\ufo\llm\openai.py", line 164, in _chat_completion
    raise Exception(f"OpenAI API request was not authorized: {e}")
Exception: OpenAI API request was not authorized: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}

Markdown file saved to logs/my_test//output.md.
Cost is not available for the model gpt-4o or gpt-4o.

보통 마지막 오류 메시지에 따라 "OpenAI API request was not authorized: Error code: 401"만 보고 API 키가 잘못되었다고 생각할 수 있는데, 그 상위의 메시지에 좀 더 정확한 오류 메시지가 포함돼 있으니 스크롤을 좀 하셔야 합니다. ^^ 즉, 위의 경우 진짜 오류는 "The API request of HOST_AGENT failed: OpenAI API request exceeded rate limit"입니다.

그나저나 ^^ 개인적으로도 처음엔 ChatGPT 유료 사용자라면 API 사용료까지 어느 정도는 기본요금제에 포함됐을 거라고 인식했었습니다. 그런데, 실제 정책은 API 사용료의 경우 완전히 별개로 운영되는데요, 아마도 이런 차이점과 함께 쓰는 만큼 나오는 요금제라서 자칫 실수하면 엄청난 요금 폭탄을 맞게 될 수 있는 여지가 있습니다.

이런 식의 사연 때문인지 OpenAI 측은 기본적으로 API 요금 상한을 0원으로 설정해 두고 있어 "... exceeded rate limit" 오류가 발생한 것입니다. 따라서 이를 사용자가 직접 다음의 화면을 통해 높여주면 됩니다.

openai_recharge_bill_1.png

Settings / Billing
; https://platform.openai.com/settings/organization/billing/overview

위의 화면에서 "Add to credit balance"를 클릭해 가격을 충전해 안전하게 사용할 수 있습니다. ^^




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 5/15/2025]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




[1]  2  3  4  5  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13928정성태5/15/202511오류 유형: 954. UFO² - "'Invalid URL (POST /v1/chat/completions/chat/completions)'"
13927정성태5/15/202559오류 유형: 953. OpenAI - The API request of HOST_AGENT failed: OpenAI API request exceeded rate limit: Error code: 429
13926정성태5/14/2025362개발 환경 구성: 743. LLM과 윈도우의 만남 - Desktop AgentOS UFO² 기본 환경 구성
13925정성태5/12/2025841닷넷: 2333. C# - (Console 유형의 프로젝트에서) Clipboard 연동파일 다운로드1
13924정성태5/8/20251076닷넷: 2332. C# - (JetBrains Omea Reader 대상으로) 런타임 시에 메서드 가로채기 [2]파일 다운로드1
13923정성태5/5/20251024스크립트: 74. 파이썬 - C# - Python.NET의 RunSimpleScript, Exec, Eval 차이점파일 다운로드1
13922정성태5/3/20251167스크립트: 73. 파이썬 - Windows embeddable package 버전에서 tkinter 환경 구성
13921정성태5/3/20251405오류 유형: 952. 듀얼 채널 메모리 정렬을 지키지 않은 컴퓨터의 Windows 비정상 종료 현상(Blue Screen) [2]
13920정성태5/3/20251519오류 유형: 951. Typed DataSet 생성 중 "Failed to open a connection to the database" 오류
13919정성태5/2/20251343VS.NET IDE: 201. C# - Typed DataSet(XSD)를 위한 연결 문자열 암호화 [1]파일 다운로드1
13918정성태5/2/20251547VS.NET IDE: 200. C# - app.config 파일의 출력을 Configuration(Debug/Release)에 따라 제어하는 방법파일 다운로드1
13917정성태4/30/20251220VS.NET IDE: 199. Directory.Build.props에 정의한 속성에 대해 Condition 제약으로 값을 변경하는 방법
13916정성태4/23/20251078디버깅 기술: 221. WinDbg 분석 사례 - ASP.NET HttpCookieCollection을 다중 스레드에서 사용할 경우 무한 루프 현상 - 두 번째 이야기
13915정성태4/13/20252041닷넷: 2331. C# - 실행 시에 메서드 가로채기 (.NET 9)파일 다운로드1
13914정성태4/11/20252332디버깅 기술: 220. windbg 분석 사례 - x86 ASP.NET 웹 응용 프로그램의 CPU 100% 현상 (4)
13913정성태4/10/20251534오류 유형: 950. Process Explorer - 64비트 윈도우에서 32비트 프로세스의 덤프를 뜰 때 "Error writing dump file: Access is denied." 오류
13912정성태4/9/20251278닷넷: 2330. C# - 실행 시에 메서드 가로채기 (.NET 5 ~ .NET 8)파일 다운로드1
13911정성태4/8/20251550오류 유형: 949. WinDbg - .NET Core/5+ 응용 프로그램 디버깅 시 sos 확장을 자동으로 로드하지 못하는 문제
13910정성태4/8/20251747디버깅 기술: 219. WinDbg - 명령어 내에서 환경 변수 사용법
13909정성태4/7/20252623닷넷: 2329. C# - 실행 시에 메서드 가로채기 (.NET Framework 4.8)파일 다운로드1
13908정성태4/2/20252859닷넷: 2328. C# - MailKit: SMTP, POP3, IMAP 지원 라이브러리
13907정성태3/29/20252782VS.NET IDE: 198. (OneDrive, Dropbox 등의 공유 디렉터리에 있는) C# 프로젝트의 출력 경로 변경하기
13906정성태3/27/20252886닷넷: 2327. C# - 초기화되지 않은 메모리에 접근하는 버그?파일 다운로드1
13905정성태3/26/20252787Windows: 281. C++ - Windows / Critical Section의 안정화를 위해 도입된 "Keyed Event"파일 다운로드1
13904정성태3/25/20252369디버깅 기술: 218. Windbg로 살펴보는 Win32 Critical Section파일 다운로드1
[1]  2  3  4  5  6  7  8  9  10  11  12  13  14  15  ...