1815, "free from local, provincial, or national prejudices and attachments," from cosmopolite "citizen of the world" (q.v.) on model of metropolitan. From 1833 as "belonging to all parts of the world, limited to no place or society." Meaning "composed of people of all nations, multi-ethnic" is from 1840. The U.S. women's magazine of the same name was first published in 1886.
As a noun, "one who is at home all over the world, a cosmopolite," 1640s. As the name of a vodka-based cocktail popular in 1990s (due to "Sex and the City" TV program) from late 1980s (the drink itself seems to date to the 1970s).
Cosmopolitanism in reference to an ideology that considers all humans as a single community is recorded by 1828. It took on a negative tinge in mid-20c., suggesting an undermining of indigenous and national societies and often tied to the supposed influence of the Jews.