> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://helpdesk.gbnetwork.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to Use the OpenClaw API

This guide walks you through enabling the OpenAI-compatible API endpoint on your OpenClaw VPS, allowing external tools to connect directly to your private AI agent.

### What Is the OpenClaw API?

This feature makes a Chat Completions API endpoint available on your VPS using OpenAI's API format. External applications like Cursor IDE, n8n, ElevenLabs, etc can then connect to your private OpenClaw agent.

### Why Enable It?

* **Use Your Agent in Your Favorite Tools**: Connect your private AI to coding assistants, automation workflows, or voice apps.
* **Standard Compatibility**: Works with any app that supports the OpenAI API.

### Prerequisites

* An active OpenClaw VPS
* SSH access to your VPS (see the [Essential Command Guide](https://helpdesk.gbnetwork.com/en/article/openclaw-vps-essential-command-guide-16bjh1r/))

|| If you're new to OpenClaw, feel free to check out this [__guideline__](https://helpdesk.gbnetwork.com/en/article/openclaw-vps-quick-start-guide-21trmo/).
---
### How to Enable the API

1. Run setup command: `setup-api`.
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/setup-api_rlg236.png =497x163)

2. The system will prompt you to confirm. You may proceed by typing `y` and pressing Enter.
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/setup-api-1_1uvdp6t.png =497x217)

3. Wait while the system configures and restarts the service. Once completed, your unique API details will be displayed.
![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/setup-api-2_9zrlz6.png =497x285)

|| **Note:** Copy your endpoint URL for reference.
---
### How to Disable the API

If you no longer need the API enabled, you can disable it anytime:

```
setup-api off
```

![](https://storage.crisp.chat/users/helpdesk/website/-/6/7/9/3/67938060e89a4400/setup-api-off_1sduh8u.png =497x235)

The system will process the request and restart OpenClaw services to apply the change.
---

### Need Further Assistance?

If you face any issues or need assistance, don’t hesitate to reach out — **our support team is always ready to help!**

🔧 **Need help?** [**Submit a Support Ticket**](https://secure.gbnetwork.com/submitticket.php)
💬 **Chat with us on Live Chat via our** [**website**](https://www.gbnetwork.my/)
