Initialization

To get started, first make sure you've imported the hub.php library:

include 'hub.php';

Then, initialize a new HF Hub API object:

$api = new Hub('<your_hf_token>');

Note

Don't have a Hugging Face token yet? Get one here! All you need is a free Hugging Face account. Make sure the token's role is set to write for all methods to work!