A nonlinear viscoelastic model is developed for the dynamics of nanotubes conveying fluid. The influences of strain gradients and stress nonlocality are incorporated via a nonlocal strain gradient theory (NSGT). Since at nanoscales, the assumptions of no-slip boundary conditions are not valid, the Beskok–Karniadakis theory is used to overcome this problem. The coupled nonlinear differential equations are derived via performing an energy/work balance. The derived equations along the transverse and axial axes are simultaneously solved to obtain the nonlinear frequency response. For this purpose, Galerkin's technique together with a continuation method are utilized. The frequency response is investigated in both subcritical and supercritical flow regimes.