A measurement of the cross section for the production of top quark–antiquark pairs ( tt¯ ) in association with a vector boson V (W or Z) in proton-proton collisions at s=8 TeV is presented. The results are based on a dataset corresponding to an integrated luminosity of 19.5 fb -1 recorded with the CMS detector at the LHC. The measurement is performed in three leptonic (e and μ ) channels: a same-sign dilepton analysis targeting tt¯W events, and trilepton and four-lepton analyses designed for tt¯Z events. In the same-sign dilepton channel, the tt¯W cross section is measured as σtt¯W=170-80+90(stat)±70(syst)fb , corresponding to a significance of 1.6 standard deviations over the background-only hypothesis. Combining the trilepton and four-lepton channels, a direct measurement of the tt¯Z cross section, σtt¯Z=200-70+80(stat)-30+40(syst)fb-1 , is obtained with a significance of 3.1 standard deviations. The measured cross sections are compatible with standard model predictions within their experimental uncertainties. The inclusive tt¯V process is observed with a significance of 3.7 standard deviations ... mehr from the combination of all three leptonic channels.