A novel two-phase approach to manage the daily operation of proton exchange membrane (PEM) fuel cells for residential applications is presented in this paper. Conventionally, the performance optimization is carried out offline since it is a time-consuming process and needs high computational capabilities. To simplify the management process and to enable online parameter updating, the paper suggests a new technique using artificial neural networks (ANNs). First, a database is extracted by performing offline optimization processes at different load demands and natural gas and electricity tariffs using a genetic algorithm (GA). Then, the obtained results are used for the offline training and testing of the ANN, which can be used onsite to define the settings of the fuel cell. The tariffs and load demands as inputs of the ANN can be easily updated online to enable the ANN to estimate new optimal or quasioptimal set points after each variation in operating points. The agreement between ANN decisions and optimal values as well as the achieved reduction in operating costs encourage the implementation of the proposed technique to achieve both fast online adaptation of settings and near optimal operating cost. This technique is applicable for different distributed generating units (DGUs), which are expected to spread within the power systems in the near future.