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)
13779정성태10/22/20245208개발 환경 구성: 729. WSL 2 - Mariner VM 커널 이미지 업데이트 방법
13778정성태10/21/20246238C/C++: 181. C/C++ - 소스코드 파일의 인코딩, 바이너리 모듈 상태의 인코딩
13777정성태10/20/20245255Windows: 265. Win32 API의 W(유니코드) 버전은 UCS-2일까요? UTF-16 인코딩일까요?
13776정성태10/19/20245804C/C++: 180. C++ - 고수준 FILE I/O 함수에서의 Unicode stream 모드(_O_WTEXT, _O_U16TEXT, _O_U8TEXT)파일 다운로드1
13775정성태10/19/20245960개발 환경 구성: 728. 윈도우 환경의 개발자를 위한 UTF-8 환경 설정
13774정성태10/18/20245596Linux: 91. Container 환경에서 출력하는 eBPF bpf_get_current_pid_tgid의 pid가 존재하지 않는 이유
13773정성태10/18/20245333Linux: 90. pid 네임스페이스 구성으로 본 WSL 2 + docker-desktop
13772정성태10/17/20245595Linux: 89. pid 네임스페이스 구성으로 본 WSL 2 배포본의 계층 관계
13771정성태10/17/20245467Linux: 88. WSL 2 리눅스 배포본 내에서의 pid 네임스페이스 구성
13770정성태10/17/20245778Linux: 87. ps + grep 조합에서 grep 명령어를 사용한 프로세스를 출력에서 제거하는 방법
13769정성태10/15/20246550Linux: 86. Golang + bpf2go를 사용한 eBPF 기본 예제파일 다운로드1
13768정성태10/15/20245897C/C++: 179. C++ - _O_WTEXT, _O_U16TEXT, _O_U8TEXT의 Unicode stream 모드파일 다운로드2
13767정성태10/14/20245195오류 유형: 929. bpftrace 수행 시 "ERROR: Could not resolve symbol: /proc/self/exe:BEGIN_trigger"
13766정성태10/14/20244857C/C++: 178. C++ - 파일에 대한 Text 모드의 "translated" 동작파일 다운로드1
13765정성태10/12/20245752오류 유형: 928. go build 시 "package maps is not in GOROOT" 오류
13764정성태10/11/20246174Linux: 85. Ubuntu - 원하는 golang 버전 설치
13763정성태10/11/20245409Linux: 84. WSL / Ubuntu 20.04 - bpftool 설치
13762정성태10/11/20245434Linux: 83. WSL / Ubuntu 22.04 - bpftool 설치
13761정성태10/11/20245279오류 유형: 927. WSL / Ubuntu - /usr/include/linux/types.h:5:10: fatal error: 'asm/types.h' file not found
13760정성태10/11/20246088Linux: 82. Ubuntu - clang 최신(stable) 버전 설치
13759정성태10/10/20247052C/C++: 177. C++ - 자유 함수(free function) 및 주소 지정 가능한 함수(addressable function) [6]
13758정성태10/8/20246008오류 유형: 926. dotnet tools를 sudo로 실행하는 경우 command not found
13757정성태10/8/20246146닷넷: 2306. Linux - dotnet tool의 설치 디렉터리가 PATH 환경변수에 자동 등록이 되는 이유
13756정성태10/8/20246299오류 유형: 925. ssh로 docker 접근을 할 때 "... malformed HTTP status code ..." 오류 발생
13755정성태10/7/20246790닷넷: 2305. C# 13 - (9) 메서드 바인딩의 우선순위를 지정하는 OverloadResolutionPriority 특성 도입 (Overload resolution priority)파일 다운로드1
13754정성태10/4/20246102닷넷: 2304. C# 13 - (8) 부분 메서드 정의를 속성 및 인덱서에도 확대파일 다운로드1
1  2  3  4  5  6  [7]  8  9  10  11  12  13  14  15  ...