There are three Vending Machines in Yume Nikki, found in the Dense Woods, in Hell and in the Docks from which the player can buy health to increase Madotsuki's Hit Points (HP).
Yen
Yen is the currency required to operate vending machines, and has no other function in the game.
Yen is acquired by killing NPCs with the Knife Effect. Most killable NPCs give a 1 in 8 chance of yielding 100 yen when killed with the knife, except for the warping alien in the Sky Garden that always produces yen every time it is killed, and the Greater Goblin in the courtyard room of the Basement of the FC House that has a 50% chance of yielding 200 Yen.
The amount of Yen in your possession can be checked in the pause menu in the bottom-left corner of the screen.
Health
Vending machines sell pink drinks that increase your Hit Points. However, there is no practical benefit from this as there are no damage hazards that can physically hurt Madotsuki in her dreams. Therefore, there is no need at any point in the game to increase Madotsuki's HP other than for personal satisfaction of the player. This feature was probably included as a homage to traditional games, as a subtle joke or to highlight the unique nature of Yume Nikki as an RPG.
Misleading Message
Upon operating a vending machine, the game does not inform you of the HP increase, instead displaying the message 'Window scheme changed'. In actual fact, this is not true and the menu color scheme can only be changed by interacting with the Lunatic Toriningen behind the counter in a room in the Mall. This error is likely a programming mistake or an unremoved artefact of the vending machine's function in a previous version of Yume Nikki.
Variations between Vending Machines
Dense Woods
The vending machine here dispenses the 350ml can of 'Health drink'. It costs 100 Yen and increases HP by 1 point.
Hell
The vending machine here dispenses the 500ml bottle of 'Health drink'. It costs 130 Yen and increases HP by 1 point, and has a 33% chance of increasing HP by an additional 1 point.
Docks
The vending machine here dispenses the 1.5 liter bottle of 'Health drink'. It costs 150 Yen and increases HP by 1 point, and has a 50% chance of increasing HP by an additional 1 point.