Astro build toml CORS error

I’m trying to fix an CORS issue with netlify, I have a site build using astro.build and I have an API https://cleanvid-v2.netlify.app/api/metrics when I try to access to API from another site, I get the cors error.

You need to return CORS headers from the API and not netlify.toml: