Placebo hypoalgesia and nocebo hyperalgesia, which exemplify the impact of expectations on pain, have recently been conceptualised as Bayesian inferential processes, yet empirical evidence remains limited. Here, we explore whether these phenomena can be unified within the same Bayesian framework by testing the predictive role of expectations and their level of precision (ie, expectation confidence) on pain, with both predictors measured at the metacognitive level. Sixty healthy volunteers underwent a pain test (ie, 8 noxious electrical stimuli) before (Baseline) and after (T0, T1, T2) receiving a sham treatment associated with hypoalgesic (placebo), hyperalgesic (nocebo), or neutral (control) verbal suggestions, depending on group allocation. Trial-by-trial expectations, their precision, and perceived pain were measured. Skin conductance response (SCR) was also recorded as an autonomic response marker. Bayesian linear mixed models analyses revealed that, for both placebo and nocebo, pain was predicted by expectations alone and by their interaction with expectations precision. In addition, the discrepancy between expected and perceived pain was predicted by expectation precision, with greater alignment between expected and perceived pain when precision was higher. This suggests that both placebo and nocebo responses are well described from a Bayesian perspective. A main effect of time for SCR was observed, suggesting habituation to painful stimuli. Our data provide evidence indicating that both placebo hypoalgesia and nocebo hyperalgesia can be unified within the same Bayesian framework in which not only expectations but also their level of precision, both measured at the metacognitive level, are key determinants of the pain inferential process.