I had an HSA family eligible health plan for 6 months of 2023. $7040 was deposited in my HSA accounts during the year. How do I calculate and withdraw the excess?

I had the HSA plan coverage for me and my spouse from January 1 to June 13 2023. I believe $7750 is the limit for 2023 but it seems I am eligible to contribute only six months of that, so $3,875. Am I correct to ask my HSA provider for an excess contribution withdrawal of $3,165?