Twelve-time Olympic swimming medallist Ryan Lochte has been given a 14-month ban for a doping violation.

American swimmer Ryan Lochte. Photo:

The 33-year-old American has been sanctioned by the US Anti-Doping Agency for an intravenous infusion.

While Lochte was not using a banned substance, athletes cannot usually receive IVs unless related to a hospitalisation or via an exemption.

Lochte posted a photo of himself on social media receiving the IV which prompted an investigation.

In 2016, Lochte was banned from the sport for 10 months after falsely claiming he was robbed at gunpoint during the Rio Olympic Games.

Lochte said he and three team-mates were held up at a petrol station during a night out.

But police questioned the account after CCTV footage showed the group had vandalised the petrol station.