Recycling biomass and generating value-added products, such as protein, from wastewater treatment using photosynthetic bacteria (PSB), represents a promising avenue for renewable resources. However, there are several crucial factors that can influence the efficiency of protein production in PSB. In this study, response surface methodology was employed to assess and optimize the effects of carbon and nitrogen sources on protein and biomass production, respectively. A three-factor central composite design (CCD) analysis revealed that the highest biomass and protein production, reaching 1.267 and 0.459g/L, respectively, were achieved under the optimal conditions of 0.442% sodium acetate (X1), 0.577% sodium bicarbonate (X2), and 0.5105% fructose (X3). Another three-factor CCD analysis focusing on nitrogen sources demonstrated that the corresponding biomass and protein production were 1.288 and 0.417g/L, respectively, under the optimal conditions of 0.600% urea (X4), 0.679% ammonium sulfate (X5), and 0.805% sodium glutamate (X6). The experimental results and predicted biomass and protein production were shown to be very comparable, verifying the predictability of the used models. This research provides the basis for developing a green and economic PSB wastewater treatment process and for promoting the widespread use of protein recovery.