I believe the 2013 Mac Pro was the first without Audio In.

2010 Macs did have an Audio In and Out jacks as did everything prior going back to the Mac. They were optical but took TRS plugs. You could buy $1.35 adapters to enable the 5.1 surround sound channel optical port.

My 2012 MacBook Pros have them, also, but I don't know if those ports still support optical. Unfortunately, this support doc doesn't tell us what years had which but it does show the port symbols.
Apple Audio Ports Support doc

I was way disappointed when my iMac Pro no longer supported optical in the headphone/audio out jack. I had to sell a perfectly good 5.1 surround sound system powered by an optical controller. I expected the Audio In jack to be gone but I hadn't used that since before my Beige G3 in the 1990s.


BIAB 2024 Audiophile Mac
24Core/60CoreGPU M2 MacStudioUltra/8TB/192GB Sequoia, M1 MBAir, 2012 MBP
Digital Performer11, LogicPro, Finale27/Dorico/Encore/SmartScorePro64/Notion6 /Overture5