The main finding of this study is that smoking history, hypertension, and opioids were associated with thyroid-related adverse events in patients taking anti-PD-1 or PD-L1. Here, CD274 is linked to thyroiditis.