Which tools should I use for a gallery that uses an API and url for the path of the images?

Make a page and assign a custom page template that includes a form which references itself in the action#.

Then just check the $_REQUEST for the information sent by the form.

There are several functions in the HTTP API that will help you send a request to your API and handle the request.

It doesn’t look like you need anything from the REST API on your site, so don’t worry about that.

If you want to go the AJAX route and not leave the page, there are several examples on how to use admin-ajax.php or admin-post.php.