For several years, the role of immune system in the pathophysiology of psychosis has been well-recognized, showing differences from the onset to chronic phases. Our study aims to implement a biomarker-based classification model suitable for the clinical management of psychotic patients. A machine learning algorithm was used to classify a cohort of 362 subjects, including 160 first-episode psychosis patients (FEP), 70 patients affected by chronic psychiatric disorders (schizophrenia, bipolar disorder, and major depressive disorder) with psychosis (CRO) and 132 health controls (HC), based on mRNA transcript levels of 56 immune genes. Models distinguished between FEP, CRO, and HC and between the subgroup of drug-free FEP and HC with a mean accuracy of 80.8% and 90.4%, respectively. Interestingly, by using the feature importance method, we identified some immune gene transcripts that contribute most to the classification accuracy, possibly giving new insights on the immunopathogenesis of psychosis. Therefore, our results suggest that our classification model has a high translational potential, which may pave the way for a personalized management of psychosis.