> For the complete documentation index, see [llms.txt](https://syrows-development.gitbook.io/smartcommands/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://syrows-development.gitbook.io/smartcommands/tools/apibuilder.md).

# ApiBuilder

This is a guide to learn how to initialize SmartCommands using the ApiBuilder class.

### Initialize the API

To use `SmartCommands`, you must first initialize the API using the `ApiBuilder` class. First, create a new instance of the internal class `ApiBuilder`.

```java
new SmartCommandsAPI.ApiBuilder()
```

### ApiBuilder properties

| Property           | Default value     |
| ------------------ | ----------------- |
| `debug`            | `false`           |
| `commandsFilePath` | `"commands.json"` |

You can change the value of these properties using the following methods.

| Method                               | Description                                                        |
| ------------------------------------ | ------------------------------------------------------------------ |
| `debug(boolean debug)`               | Set `true` to enable the debugger or else set `false`              |
| `setCommandsFolderPath(String path)` | Set the path of the folder which contains the `commands.json` file |
| `build(Plugin plugin)`               | Initialize the API with the previously configured options          |

{% hint style="info" %}
Only the `build(Plugin plugin)` method is needed to initialize the API. The others are optional.
{% endhint %}

### Example

```java
SmartCommandsAPI api = new SmartCommandsAPI.ApiBuilder().build(this);
```

{% content-ref url="/pages/-LmAgmBDdl7l0TxnUoVJ" %}
[Get started](/smartcommands/get-started.md)
{% endcontent-ref %}
