How to get a run id by its index?

Hello! Recent update (1.24.0) has introduced an artifact download API which allows to download artifacts using christopherhx/gitea-download-artifact@v4 action (see more: Artifacts download api for artifact actions v4 by ChristopherHX · Pull Request #33510 · go-gitea/gitea · GitHub).
However it requires a run id to be passed to the action. Can somebody please tell me how to get the run id knowing run index?