An apparatus for dispensing medications, including: a dispensing device storing prescription information including: identification of each medication included in a first plurality of medications; a respective dosage for each medication; and a plurality of time spans, including respective points in time, for dispensing the first plurality of medications; a cassette installed in the dispensing device and including a plurality of sealed compartments, each compartment in the plurality of sealed compartments configured to store at least one respective pill for each medication in a second plurality of medications; and at least one dispensing port. The dispensing device is configured to, within each time span in the plurality of time spans and when the second plurality of medications is in compliance with the prescription information: access each compartment via the at least one dispensing port; and extract every at least one first pill from each compartment.