The Blues made a bright start in Swansea and opened up an eight-point lead thanks to Nick Williams’ try and the boot of Gareth Anscombe.
But the Ospreys took a stranglehold on the game and dominated for long periods with Dan Biggar showing his class at fly-half.
The home side led 17-14 at the interval thanks to tries from Jeff Hassler and Rhys Webb. The Wales scrum-half claimed a stunning second score following the break and Justin Tipuric crossed to secure the bonus-point.
That appeared to put the result beyond doubt but Wales’ Capital Region refused to be denied and they battled back with late tries from Owen Lane and Garyn Smith.
Anscombe put his side within a point following the conversion, and despite a series of late penalties for the visitors, Steve Tandy's side held out for a victory, which puts Ospreys within four points of Cardiff Blues in Conference A.
It took Cardiff Blues just 29 seconds to open the scoring after Nicky Smith was penalised for holding on virtually straight from the kick-off.
Anscombe made no mistake with the simple penalty to give his side an early lead but the Ospreys soon took a territorial hold on the game thanks to a succession of fortunate penalties.
On each occasion Dan Biggar kicked long to the corner but the Blues held up well and earned either forced indiscipline or mistakes to clear their lines.
With 10 minutes on the clock, the Blues enjoyed their first real period of possession in Ospreys territory, thanks to the clever kicking of Lloyd Williams from the base.
The Blues began to hit their stride and they were unfortunate not to get more after a delightful inside flick from Nick Williams at a lineout was aimed for Kristian Dacey on the peel.
Rhys Webb managed to get a hand to it and the Blues were perhaps unfortunate not to be awarded a penalty but they went on the attack from the ensuing scrum.
With a fine set move Anscombe released Rey Lee-Lo, who sliced through the Ospreys defence and pinned his ears back.
He didn’t quite have the pace to reach the white wash but flicked the ball back inside and Sam Davies was forced to run into touch.
That gave the visitors prime attacking position and they needed no second invitation as Williams crashed over after Josh Navidi went close.
Anscombe was unable to split the sticks from the right touchline and the Ospreys soon hit back against the run of play.
After collecting a high ball Matthew Morgan went on the counter-attack and looked to find Owen Lane in support but his pass was read by Jeff Hassler, who intercepted and raced 40 metres.
He was caught by Alex Cuthbert, who refused to give up, but it was just a yard from the line and momentum carried the Canadian over.
Dan Biggar converted from wide and while the Blues responded with an Anscombe penalty, the Ospreys soon claimed a second try thanks to a moment of individual brilliance from the Wales fly-half.
Following a scrappy period of play, he spotted a miss-match and chipped over the top. The ball sat up for him perfectly and he flicked it inside to Rhys Webb, who cantered home to take the lead.
Biggar added the simple extras before Anscombe drew level just after the half-hour mark but the stalemate did not last long as Nigel Owens awarded the hosts a dubious penalty.
The Ospreys began the second-half playing a much more direct brand of rugby, utilising a succession of pick-and-goes at the breakdown.
They enjoyed sustained periods of pressure but were unable manufacture points as Alun Wyn Jones coughed up possession.
However, they took a major stride towards victory with their third try, and Rhys Webb’s second, on 52 minutes.
Biggar was again the architect as he spotted space outside and found Ashley Beck with a cross-kick. The centre combined with Justin Tipuric, who then found Webb in support.
The Ospreys fly-half added the conversion to extend their lead to 10-points and they virtually put the result beyond doubt with the bonus-point try on 64 minutes.
Cardiff Blues hung on in the face of wave after wave of Ospreys attack but when Alex Cuthbert was sin-bin the hosts showed their ruthless edge.
Biggar took the quick penalty and cross kicked to Tipuric, who caught the ball unopposed to dot down.
A glimmer of hope still remained and when Owen Lane powered over with nine minutes to go, the Blues had a real sniff of salvaging something.
A speculative chip and catch from Steve Shingler opened the Ospreys defence in the closing stages and he found Tomos Williams in support.
The replacement scrum-half linked with Cuthbert, who then found Lee-Lo on the outside. He was stopped but possession was maintained and Smith cut back inside for a stunning score, which Anscombe converted.
Ospreys won a penalty in the late stages and opted to kick for the corner. However, the resulting line-out was over-thrown, gifting the visitors possession.
A series of offside penalties took Danny Wilson's side up to the halfway mark, but, following numerous phases, a knock-on in midfield brought the spectacle to an end, with the Blues claiming a losing bonus point.