Sewer pipelines, although primarily designed for sewage transport, can also be considered as bioreactors. In-sewer processes may lead to significant variations of chemical loadings from source release points to the treatment plant influent. In this study, we assessed in-sewer utilization of growth substrates (primary metabolic processes) and transformation of illicit drug biomarkers (secondary metabolic processes) by suspended biomass. Sixteen drug biomarkers were targeted, including mephedrone, methadone, cocaine, heroin, codeine and tetrahydrocannabinol (THC) and their major human metabolites. Batch experiments were performed under aerobic and anaerobic conditions using raw wastewater, and abiotic biomarker transformation and partitioning to suspended solids and reactor wall were separately investigated under both redox conditions. A process model was identified by combining and extending Wastewater Aerobic/anaerobic Transformations in Sewers model (WATS) and Activated Sludge Model for Xenobiotics (ASM-X). Kinetic and stoichiometric model parameters were estimated using experimental data via the Bayesian optimization method DREAM(ZS). Results suggest that biomarker transformation significantly differs from aerobic to anaerobic conditions, and abiotic conversion is the dominant mechanism for many of the selected substances. Notably, explicit description of biomass growth during batch experiments was crucial to avoid significant overestimation (up to 385%) of aerobic biotransformation rate constants. Predictions of in-sewer transformation provided here can reduce the uncertainty in the estimation of drug consumption as part of wastewater-based epidemiological studies.