Late Update
Looks like they have finally created the runner api. See the API specs here.
![[POST] /repos/{owner}/{repo}/actions/runners/registration-token](../../images/3821276311.webp)
They now also have example snippets on how to do this. See the other answer posted here for a complete example.
Previous Answer
For now you have to create instances manually using the guide found here.
According to a github staff, there is a plan to eventually add an api for generating the runner tokens, but didn't disclose a timeline of when this could happen.
An API for this is on the roadmap. I don't have a timeline to share at
the moment. But we'll be posting to the Changelog when this is
available.
And to clear up some of the confusion around PATs/runner tokens. The
runner token provided via the UI is a temporary token that expires
after 60 minutes. It only has the ability to register runners.
PATs are not able to register runners.