Flux qubits in 3D cavities