diff --git a/claude_setup.sh b/claude_setup.sh index bcd49ef..2f90aac 100755 --- a/claude_setup.sh +++ b/claude_setup.sh @@ -303,6 +303,18 @@ _handle_api_response() { echo -e "\033[0;33m[СЕТЬ]\033[0m Не удалось проверить ключ (нет сети?). Продолжаю..." return 0 ;; + 400) + _emsg=$(_claude_extract_error "$body") + if echo "$_emsg" | grep -qi "RESOURCE_EXHAUSTED"; then + echo "" + echo -e "\033[0;33m[КВОТА ИСЧЕРПАНА]\033[0m Лимит запросов исчерпан." + [ -n "$topup_url" ] && echo " $topup_url" + return 429 + fi + # 400 = auth is valid, but max_tokens=1 is too small for thinking models + echo -e "\033[0;32mOK\033[0m" + return 0 + ;; *) _emsg=$(_claude_extract_error "$body") echo ""