Midfielder Kevin Cooper scored first on 18 minutes with a powerful left-foot drive after cutting in from the wing.
Cooper's croner then found its way to the unmarked Cox to convert from six yards on the half hour mark.
Cox rose to head home Neal Ardley's cross in the 68th minute to complete the scoring, before Stoke rallied as Hannes Sigurdsson twice went close.
Stoke boss Johan Boskamp:
"We had warned the players beforehand about Cooper's left foot but we still allowed him to drift inside and shoot."
Boskamp was also bemused by the continued absence of Guinea striker Sanbegou Bangoura.
He said: "I don't know what has happened to him since he left for the African Nations Cup."
Cardiff: Alexander, Ardley, Purse, Cox, Barker, Scimeca, Boland, Ledley, Cooper, Jerome, Ndumbu-Nsungu.
Subs Not Used: Margetson, Whitley, Weston, Mulryne, Ferretti.
Booked: Ndumbu-Nsungu, Purse.
Goals: Cooper 18, Cox 30, 68.
Stoke: Simonsen, Broomes (Hill 68), Hoefkens, Duberry, Buxton, Henry, Brammer (Junior 77), Sweeney (Kopteff 45), Skoko, Sidibe, Sigurdsson.
Subs Not Used: de Goey, Rooney.
Ref: M Jones (Wales).