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)
How to Enable the API
- Run setup command:
setup-api.

- The system will prompt you to confirm. You may proceed by typing
yand pressing Enter.

- Wait while the system configures and restarts the service. Once completed, your unique API details will be displayed.

How to Disable the API
If you no longer need the API enabled, you can disable it anytime:
setup-api off

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
💬 Chat with us on Live Chat via our website
Updated on: 03/03/2026
Thank you!