There are two types of rewrite rules in WordPress: internal rules (stored in the database and parsed by WP::parse_request()), and external rules (stored in
.htaccess and parsed by Apache). You can choose either way, depending on how much of WordPress you need in your called file.
The external rule is the easiest to set up and to follow. It will execute
my-api.php in your plugin directory, without loading anything from WordPress