Creating fully implantable robots that replace or restore physiological processes is a great challenge in medical robotics. Restoring blood glucose homeostasis in patients with type 1 diabetes is particularly interesting in this sense. Intraperitoneal insulin delivery could revolutionize type 1 diabetes treatment. At present, the intraperitoneal route is little used because it relies on accessing ports connecting intraperitoneal catheters to external reservoirs. Drug-loaded pills transported across the digestive system to refill an implantable reservoir in a minimally invasive fashion could open new possibilities in intraperitoneal delivery. Here, we describe PILLSID (PILl-refiLled implanted System for Intraperitoneal Delivery), a fully implantable robotic device refillable through ingestible magnetic pills carrying drugs. Once refilled, the device acts as a programmable microinfusion system for precise intraperitoneal delivery. The robotic device is grounded on a combination of magnetic switchable components, miniaturized mechatronic elements, a wireless powering system, and a control unit to implement the refilling and control the infusion processes. In this study, we describe the PILLSID prototyping. The device key blocks are validated as single components and within the integrated device at the preclinical level. We demonstrate that the refilling mechanism works efficiently in vivo and that the blood glucose level can be safely regulated in diabetic swine. The device weights 165 grams and is 78 millimeters by 63 millimeters by 35 millimeters, comparable with commercial implantable devices yet overcoming the urgent critical issues related to reservoir refilling and powering.