An apparatus for converting chemical energy into electrical energy or electrical energy into chemical energy, comprising a housing having at least one open side and in which a pressure chamber is formed, and at least one electrochemically active cell err for generating energy that extends from the open side of the housing into the housing, the open side being closed by a plate that holds or supplies power to the cell, wherein a closure is provided between the housing and the plate, closes the open side of the housing in a fluid- or gas-tight manner thereby forming the pressure chamber, and is at least partially made of an elastic material, and wherein the closure has at least one pocket that extends into the pressure chamber and in which the cell is positioned, and the pocket wall of which is flexible due to the elastic material so that the pocket wall bears against the cell in the case of overpressure in the pressure chamber