Zend certified PHP/Magento developer

Is it possible to use a different URL for the API calls from what I use for the website?

What I want to do is:
Site URL: example.com
API URL: api.example.com

And how can I do this?
I m currently using magento 2.4.5

I would like the api url to be only for API calls not for the whole site again.

thanks