Plugins may extend the API simply by offering public model methods. Take for example a plugin called FooBar. The FooBar plugin may have the following model:

<?php
class FooBarSprocket extends FooBarModel {
 
 public function create(array $vars) {
 
 }
 
 public function delete($sprocket_id) {
 
 }
 
 private function calculateCost($sprocket_id) {
 
 }
}
?>

FooBarSprocket offers two public methods and one private method. Both FooBarSprocket::create() and FooBarSprocket::delete() are made available via the API at the following URLs, respectively:

https://yourdomain.com/installpath/index.php/api/foo_bar.foo_bar_sprocket/create.json?vars[price]=1.99
https://yourdomain.com/installpath/index.php/api/foo_bar.foo_bar_sprocket/delete.json?sprocket_id=123
Only public model methods are accessible via the API.