I just look into the gitolite but it doesn't have API. To clarify, what I mean is REST style API via http.
https://docs.gitea.io/en-us/api-usage/
It's not headless but maybe there is a way to shut down the HTML interface. But probably the same could be said of GitLab.