> ## Documentation Index
> Fetch the complete documentation index at: https://kiosapi.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure OpenClaw CLI to Use KiosAPI as a Provider

> Connect OpenClaw's open-source CLI coding agent to KiosAPI by setting the API base URL and key, enabling any OpenAI-compatible model through KiosAPI.

OpenClaw is an open-source CLI coding agent that supports multiple LLM providers through an OpenAI-compatible interface. This tutorial walks you through installing OpenClaw, pointing it at KiosAPI via environment variables and a config file, and verifying that it works correctly.

## Prerequisites

* **Node.js 18+** or **Bun**
* A **KiosAPI API key** (starts with `sk-`) from the [Dashboard](https://kiosapi.com) → **Token Management**

<Steps>
  ### Install OpenClaw

  <Tabs>
    <Tab title="npm">
      ```bash theme={null}
      npm install -g openclaw
      ```
    </Tab>

    <Tab title="Bun">
      ```bash theme={null}
      bun install -g openclaw
      ```
    </Tab>
  </Tabs>

  Verify the installation:

  ```bash theme={null}
  openclaw --version
  ```

  ### Set environment variables

  OpenClaw reads the API key and base URL from environment variables.

  <Tabs>
    <Tab title="macOS / Linux">
      Add the following to `~/.bashrc` or `~/.zshrc`:

      ```bash theme={null}
      export OPENAI_API_KEY="sk-xxx"
      export OPENAI_BASE_URL="https://kiosapi.com/v1"
      ```

      Then reload your shell:

      ```bash theme={null}
      source ~/.bashrc  # or ~/.zshrc
      ```
    </Tab>

    <Tab title="Windows (PowerShell)">
      ```powershell theme={null}
      setx OPENAI_API_KEY "sk-xxx"
      setx OPENAI_BASE_URL "https://kiosapi.com/v1"
      ```
    </Tab>
  </Tabs>

  Replace `sk-xxx` with your actual KiosAPI key.

  ### Create the config file

  Create or edit `~/.openclaw/config.json`:

  ```json theme={null}
  {
    "provider": "openai",
    "apiBase": "https://kiosapi.com/v1",
    "apiKey": "sk-xxx",
    "model": "gpt-4o"
  }
  ```

  Replace `sk-xxx` with your actual KiosAPI key.

  <Tip>
    You can use any OpenAI-compatible model available on KiosAPI. Check the [models list](../api-reference/models/list-models) for available options.
  </Tip>

  ### Verify your setup

  Run a quick test to confirm everything is connected:

  ```bash theme={null}
  openclaw "Say hello"
  ```

  If OpenClaw responds, your configuration is working correctly.
</Steps>

## Usage

<CodeGroup>
  ```bash Interactive mode theme={null}
  openclaw
  ```

  ```bash Direct question theme={null}
  openclaw "Create a React component for a todo list"
  ```

  ```bash Specify a model theme={null}
  openclaw --model claude-sonnet-4-6 "Refactor this function"
  ```
</CodeGroup>

## Troubleshooting

### Authentication error

* Verify your API key is set correctly and starts with `sk-`
* Ensure `apiBase` in the config file matches the `OPENAI_BASE_URL` environment variable

### Connection error

* Confirm the base URL is `https://kiosapi.com/v1` — with `/v1`
* Check your network and firewall settings

## Need Help?

* [KiosAPI Dashboard](https://kiosapi.com)
* [Available Models](../api-reference/models/list-models)
