# OpenClaw AI/ML

## About

OpenClaw is an AI platform for building AI agents and assistants. It runs on your own devices and connects to popular messaging platforms (such as WhatsApp, Telegram, Slack, Discord, and others) while preserving full data privacy (all agent data is stored locally in a SQLite database).

Developers use OpenClaw to build multi-channel AI assistants with streaming responses, browser automation, vision, and voice features. It includes a local Gateway service, a CLI for management, and support for 12+ messaging platforms.

{% hint style="success" %}
**Data privacy:** OpenClaw stores data locally by default.\
Nothing is sent externally unless you configure it.
{% endhint %}

### What you get

* Multi-channel assistants and routing across 12+ messaging platforms
* Streaming responses for faster, more interactive chats
* Vision inputs for image understanding and UI analysis
* Browser automation via an OpenClaw-managed Chrome instance
* Voice integrations (platform dependent)
* Session memory and conversation history
* Tooling via skills, function calling, and external integrations
* Retries and error handling for more robust agents
* A local Gateway (binds to `localhost:18789` by default) and a CLI
* A local SQLite database containing all agent data (default path: `~/.openclaw/openclaw.db`)

***

## Prerequisites

* An AIMLAPI key obtained from your [account dashboard](https://aimlapi.com/app/keys)
* Node.js and npm
* `pnpm` if you build from source

***

## Installation

### Option 1: Install via npm (recommended)

```sh
npm install -g openclaw-aimlapi@latest
openclaw onboard --install-daemon
```

{% hint style="info" %}
`openclaw-aimlapi@latest` includes two AI/ML API skills:

* `aimlapi-media-gen` for images and video
* `aimlapi-llm-reasoning` for chat and reasoning
  {% endhint %}

The onboarding wizard installs the Gateway as a system service. It uses `launchd` on macOS and `systemd` on Linux.

### Option 2: Build from source

{% code overflow="wrap" %}

```sh
git clone -b feature/add-aimlapi-models-provider --single-branch \
  https://github.com/aimlapi/openclaw-aimlapi.git
cd openclaw

pnpm install
pnpm ui:build  # installs UI deps on first run
pnpm build

pnpm openclaw onboard --install-daemon
```

{% endcode %}

<details>

<summary>UI walkthrough (screenshots)</summary>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FFFOZlkKBnOgNuhl5EnvE%2Fimage.png?alt=media&#x26;token=cd952631-9701-40e3-98c0-aa0eca55b8f8" alt=""><figcaption><p>Install via npm</p></figcaption></figure></div>

<div align="left" data-full-width="false" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FRKswrBZnyTkfCJY0UyBa%2Fimage_2026-02-04_12-13-17%20(4).png?alt=media&#x26;token=9c171712-9d79-4e9b-8c86-40e69e0f0e69" alt=""><figcaption><p>Or build from GitHub with pnpm</p></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FRz8N9O1yqjC3d5OKY5BU%2Fimage_2026-02-04_12-13-17%20(5).png?alt=media&#x26;token=6423d22d-c8f6-4e8a-9db8-a8ed2041eb5c" alt=""><figcaption><p>Confirm installation</p></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FxpTMAx86Tod14ZmP386s%2Fimage_2026-02-04_12-13-17.png?alt=media&#x26;token=02dee5f5-f351-447a-9671-e3a4573f916c" alt=""><figcaption><p>Select "Quickstart"</p></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FpX8BywWn8tY2TPb7x0Ip%2Fimage_2026-02-04_12-13-17%20(2).png?alt=media&#x26;token=7a8fea07-b05b-4a41-9f5c-cd69e7ab7541" alt=""><figcaption><p>Select provider: AI/ML API</p></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2Fui9AN76dUcNVyXEJZuiS%2Fimage_2026-02-04_12-13-17%20(3).png?alt=media&#x26;token=2c7f752a-daaf-43c8-bef6-2fa26ffcc344" alt=""><figcaption><p>Select auth method: API Key</p></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FP2k1rFoDtyG0QGziWjZH%2Fimage_2026-02-04_12-15-51.png?alt=media&#x26;token=73dc51bf-e76b-463a-aeea-234486382879" alt=""><figcaption><p>Paste your AI/ML API key</p></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FPRYX5XXXkM1ryi0Yk0st%2Fimage_2026-02-04_12-15-51%20(2).png?alt=media&#x26;token=b5811c97-32ad-462e-821e-08ad121fa020" alt=""><figcaption><p>Select a model<br>Always include the <code>aimlapi/</code> prefix<br>Suggested: <code>aimlapi/google/gemini-3-flash-preview</code></p></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FJV8xl05rvUJpywczhE1m%2Fimage_2026-02-04_12-15-51%20(3).png?alt=media&#x26;token=55699041-ab98-473d-89d3-957aa05be342" alt=""><figcaption><p>Select a channel<br>Telegram is usually the easiest</p></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FbOeGagwm68XR4BFJFVU2%2Fimage.png?alt=media&#x26;token=4f46bde3-b073-4e7d-9a2a-e62579adc9dd" alt=""><figcaption><p>Paste your Telegram bot token</p></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FnTht7eSaVc2uV64rELBE%2Fimage.png?alt=media&#x26;token=5b8c7db3-1b74-4e16-8e20-6738d729e475" alt=""><figcaption><p>Optional: configure extra skills<br>Media skills are configured by default</p></figcaption></figure></div>

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FfSWVih0NcmaHqbgLbNdu%2Fimage_2026-02-04_12-19-26.png?alt=media&#x26;token=7ecaba96-281c-4790-aebf-0a62ac611112" alt=""><figcaption><p>Finish onboarding and open the Web UI</p></figcaption></figure></div>

<div align="left"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FhE14otfv5M4YE2OHYalc%2Fimage.png?alt=media&#x26;token=0b0b0646-0d08-4b5a-b5ee-9135f071b629" alt=""><figcaption><p>Gateway is running</p></figcaption></figure></div>

</details>

### Option 3: Install skills from the official repo (ClawHub)

Use this if you want to install or update skills separately from the OpenClaw package.

#### Install the CLI

Pick one:

```sh
npm i -g clawhub
# or
pnpm add -g clawhub
```

For more details, see: [ClawHub tool docs](https://docs.openclaw.ai/tools/clawhub).

#### Install the skills

```sh
clawhub install aiml-image-video
clawhub install aiml-llm-reasoning
```

#### How it fits into OpenClaw

* By default, `clawhub` installs skills into `./skills` under your current directory.
* If an OpenClaw workspace is configured, `clawhub` falls back to that workspace.
* Override the install location with `--workdir` or `CLAWHUB_WORKDIR`.
* OpenClaw loads workspace skills from `<workspace>/skills`.
* New skills are picked up on the next session (restart the Gateway).
* If you already use `~/.openclaw/skills` or bundled skills, workspace skills take precedence.

#### What these skills do

**`aiml-image-video`** — **Our media generation models**

Generate images and videos via two Python scripts (`gen_image.py`, `gen_video.py`).

```sh
export AIMLAPI_API_KEY="sk-aimlapi-..."
python3 ./skills/aiml-image-video/scripts/gen_image.py \
  --prompt "ultra-detailed studio photo of a lobster astronaut"
python3 ./skills/aiml-image-video/scripts/gen_video.py \
  --prompt "slow drone shot of a foggy forest"
```

**`aiml-llm-reasoning`** — **Our LLMs + Reasoning**

Run chat completions via `run_chat.py`. Use `--extra-json` for advanced params.

```sh
export AIMLAPI_API_KEY="sk-aimlapi-..."
python3 ./skills/aiml-llm-reasoning/scripts/run_chat.py \
  --model aimlapi/openai/gpt-5-nano-2025-08-07 \
  --user "Summarize this in 3 bullets."
```

{% hint style="info" %}
Paths above assume you run `clawhub install ...` from your OpenClaw workspace root (so skills land in `./skills`).  If you install somewhere else, adjust the paths to match your `--workdir`.
{% endhint %}

{% hint style="info" %}
If you installed OpenClaw via `openclaw-aimlapi@latest`, you may already have AIML-related skills installed.  Use ClawHub when you specifically want the skills from the official skills repository.
{% endhint %}

***

## Configure AI/ML API in OpenClaw

Use the Web UI from onboarding. The default URL is usually <http://127.0.0.1:59062/>.

{% stepper %}
{% step %}

### Select provider

Pick AI/ML API in the providers list.
{% endstep %}

{% step %}

### Add your API key

Use **API Key** auth. Paste the key from [aimlapi.com/app/keys](https://aimlapi.com/app/keys/).
{% endstep %}

{% step %}

### Choose a model

Use a model ID that starts with `aimlapi/`. Example:

`aimlapi/google/gemini-3-flash-preview`
{% endstep %}

{% step %}

### Choose a channel

Telegram is a good first connector. Then add more channels as needed.
{% endstep %}
{% endstepper %}

***

## Use OpenClaw

### Use via a chat connector (Telegram example)

1\. Message your bot. You will receive a pairing code.

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2Fguy8Mm6UBNTUMQtT5o6e%2Fimage.png?alt=media&#x26;token=0ae57ef3-8b89-4516-97ed-46884d92b1df" alt=""><figcaption><p>Get the pairing code</p></figcaption></figure></div>

2\. Approve the pairing:

```bash
pnpm openclaw pairing approve telegram <PAIRING_CODE>
```

{% hint style="info" %}
Expected output looks like this:

{% code overflow="wrap" %}

```bash
🦞 OpenClaw 2026.2.6-3 (fe86a9c) — Shell yeah—I'm here to pinch the toil and leave you the glory.
Approved telegram sender 835750362.
```

{% endcode %}
{% endhint %}

3\. Message your bot again. You should get a response.

<div align="left" data-with-frame="true"><figure><img src="https://3927338786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FROMd1X5PuqtikJ48n2N9%2Fuploads%2FFOhZzt8ZRQMme1I6zQEo%2Fimage_2026-02-04_12-23-18.png?alt=media&#x26;token=eb405951-f856-41e8-815e-e0350d8602b1" alt=""><figcaption><p>Agent is responding</p></figcaption></figure></div>

### Use via CLI

```bash
openclaw agent \
  --message "Tell me about yourself" \
  --model gpt-4o
```

<details>

<summary>Example response</summary>

{% code overflow="wrap" %}

```
I'm an AI language model created by OpenAI, designed to assist with a wide range of inquiries by generating human-like text based on the input I receive. I can help with answering questions, providing explanations, and even engaging in creative writing. My knowledge is based on a diverse dataset that covers a wide variety of topics up until October 2023. However, I don't have personal experiences, emotions, or consciousness. My primary goal is to be as helpful and informative as possible! If you have any specific questions or need assistance, feel free to ask.
```

{% endcode %}

</details>

### Use Cases

<details>

<summary>Example: Route Slack + Discord to the same agent</summary>

1. User messages the bot on Slack or Discord.
2. Gateway receives the message with platform context.
3. OpenClaw routes the message to the agent.
4. The agent calls AI/ML API using your chosen model.
5. The response goes back to the same channel.

</details>

<details>

<summary>Example: Analyze a web page with vision</summary>

1. User requests a web page analysis.
2. OpenClaw opens a Chrome instance (CDP-controlled).
3. OpenClaw captures a screenshot of the page.
4. The agent sends the screenshot to a vision model.
5. The model returns a description and key details.
6. OpenClaw sends the result back to the user.

</details>

***

## Supported models

* OpenAI models ([gpt-4o](https://docs.aimlapi.com/api-references/text-models-llm/openai/gpt-4o), [gpt-4o-mini](https://docs.aimlapi.com/api-references/text-models-llm/openai/gpt-4o-mini), [gpt-4-turbo](https://docs.aimlapi.com/api-references/text-models-llm/openai/gpt-4-turbo), [o3-mini](https://docs.aimlapi.com/api-references/text-models-llm/openai/o3-mini), [o1](https://docs.aimlapi.com/api-references/text-models-llm/openai/o1), and others)
* [Google models](https://docs.aimlapi.com/api-references/text-models-llm/google)
* [Anthropic models](https://docs.aimlapi.com/api-references/text-models-llm/anthropic)
* Many others, including [Qwen](https://docs.aimlapi.com/api-references/text-models-llm/alibaba-cloud) and [DeepSeek](https://docs.aimlapi.com/api-references/text-models-llm/deepseek)

***

## More

* [OpenClaw documentation](https://docs.openclaw.ai)
* [OpenClaw GitHub](https://github.com/openclaw/openclaw)
* [OpenClaw cookbook](https://github.com/openclaw/openclaw/tree/main/cookbook)
* [OpenClaw Discord](https://discord.gg/clawd)
