We investigate the driven quantum phase transition between the oscillating motion and the classical nearly free rotations of the Josephson pendulum coupled to a harmonic oscillator in the presence of dissipation. We refer to this as the Josephson-Rabi model. This model describes the standard setup of circuit quantum electrodynamics, where typically a transmon device is embedded in a superconducting cavity. We find that by treating the system quantum mechanically this transition occurs at higher drive powers than expected from an all-classical treatment, which is a consequence of the quasiperiodicity originating in the discrete energy spectrum of the bound states. We calculate the photon number in the resonator and show that its dependence on the drive power is nonlinear. In addition, the resulting multi-photon blockade phenomenon is sensitive to the truncation of the number of states in the transmon, which limits the applicability of the standard Jaynes-Cummings model as an approximation for the pendulum-oscillator system. We calculate the nth order correlation functions of the blockaded microwave photons and observe the differences between the rotating-wave approximation and the full multilevel Josephson-Rabi Hamiltonian with the counterrotating terms included. Finally, we compare two different approaches to dissipation, namely the Floquet-Born-Markov and the Lindblad formalisms. arXiv:1901.05655v2 [cond-mat.mes-hall]