The man was not seriously injured and was treated at the scene by paramedics. His mobile phone and wallet were taken.
South Wales Police said the incident in a Comet Street property began early on Wednesday.
Det Sgt Esyr Jones, from Roath CID, said: "This was an extremely frightening ordeal for the victim who was assaulted and robbed by two men who we are actively seeking.
"A machete was used during the incident and would appeal for anyone with information on the whereabouts of this weapon to contact us immediately.
"Fortunately the victim was not seriously injured and was treated by paramedics at the scene for shock and a cut to his hand.
"I want to reassure the community these types of incidents are rare and a full investigation into this incident is ongoing."
Anyone with information can contact Roath CID on 029 2052 7262 or the independent charity Crimestoppers anonymously on 0800 555 111.