We study the two coupled spin-1/2 and the two coupled spin-1 as working substance via Ising model for a quantum Carnot and Otto engine. We show that depending on the different values of the external magnetic fields and the coupling constant, the system acts as an engine or a refrigerator. The performance of the cycles depends on the values of the magnetic field and coupling constant.