Biosynthesis of NAD(P) cofactors is of special importance for cyanobacteria due to their role in photosynthesis and respiration. Despite significant progress in understanding NAD(P) biosynthetic machinery in some model organisms, relatively little is known about its implementation in cyanobacteria. We addressed this problem by a combination of comparative genome analysis with verification experiments in the model system of Synechocystis sp. strain PCC 6803. A detailed reconstruction of the NAD(P) metabolic subsystem using the SEED genomic platform (http://theseed.uchicago.edu/FIG/index.cgi) helped us accurately annotate respective genes in the entire set of 13 cyanobacterial species with completely sequenced genomes available at the time. Comparative analysis of operational variants implemented in this divergent group allowed us to elucidate both conserved (de novo and universal pathways) and variable (recycling and salvage pathways) aspects of this subsystem. Focused genetic and biochemical experiments confirmed several conjectures about the key aspects of this subsystem. (i) The product of the slr1691 gene, a homolog of Escherichia coli gene nadE containing an additional nitrilase-like N-terminal domain, is a NAD synthetase capable of utilizing glutamine as an amide donor in vitro. (ii) The product of the sll1916 gene, a homolog of E. coli gene nadD, is a nicotinic acid mononucleotide-preferring adenylyltransferase. This gene is essential for survival and cannot be compensated for by an alternative nicotinamide mononucleotide (NMN)-preferring adenylyltransferase (slr0787 gene). (iii) The product of the slr0788 gene is a nicotinamide-preferring phosphoribosyltransferase involved in the first step of the two-step non-deamidating utilization of nicotinamide (NMN shunt). (iv) The physiological role of this pathway encoded by a conserved gene cluster, slr0787-slr0788, is likely in the recycling of endogenously generated nicotinamide, as supported by the inability of this organism to utilize exogenously provided niacin. Positional clustering and the co-occurrence profile of the respective genes across a diverse collection of cellular organisms provide evidence of horizontal transfer events in the evolutionary history of this pathway.