Integrations
OpenClaw

OpenClaw

OpenClaw (opens in a new tab) is an open-source agent framework. Route OpenClaw traffic through Xilos to apply routing rules, restriction rules, guardrails, and caching to every agent call.

Prerequisites

  • A Xilos account with an active organization.
  • An API key from Settings in the Xilos dashboard, or a Virtual Key with scoped limits.
  • OpenClaw installed and initialized in your project.
  • The base URL: https://api.xilos.ai/api/v1.

Configuration

OpenClaw uses the OpenAI-compatible provider as its default backend. Set two environment variables and update the model name in your OpenClaw configuration file.

Set environment variables

OpenClaw respects the standard OPENAI_API_KEY and OPENAI_BASE_URL variables. Set them to your Xilos API key and the Xilos base URL.

export OPENAI_API_KEY="your-xilos-api-key"
export OPENAI_BASE_URL="https://api.xilos.ai/api/v1"

Add these lines to your shell profile (~/.bashrc or ~/.zshrc) so they persist across sessions.

Configure the model in your OpenClaw config

In your OpenClaw configuration file (typically openclaw.yaml or .openclaw/config.yaml), set the model name to xilos so the Xilos routing engine selects the underlying LLM:

model:
  name: xilos
  provider: openai

Run your agent

openclaw run

All LLM calls now route through Xilos.

Info: When the model name is xilos, Xilos applies your routing rules to select the best LLM for each query. To target a specific model, set model.name to a concrete model identifier (for example, claude-sonnet-4).

Verify the Connection

Send a test query from OpenClaw and confirm it appears in the Xilos dashboard:

  1. Trigger any agent action that requires an LLM call.
  2. Open your Xilos dashboard.
  3. Navigate to Query Log.
  4. Confirm the query appears with the routing decision, governance actions, and cost breakdown.
curl https://api.xilos.ai/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "xilos",
    "messages": [{"role": "user", "content": "Hello, Xilos!"}]
  }'

Troubleshooting

ProblemCauseFix
401 UnauthorizedThe API key is invalid or expired.Regenerate the key in the Xilos dashboard under Settings and update OPENAI_API_KEY.
Requests go to OpenAI directlyOPENAI_BASE_URL is not set or is overridden in the config file.Ensure OPENAI_BASE_URL is exported and that the OpenClaw config does not hardcode a different endpoint.
Routing rules do not applyThe model name is set to a concrete model instead of xilos.Set model.name to xilos so the Xilos routing engine processes each query.
403 ForbiddenA Xilos restriction rule blocked the query.Check the Query Log for the triggered rule and adjust the rule or the query content.
Connection refusedNetwork proxy or firewall blocks outbound HTTPS to api.xilos.ai.Allow outbound traffic to https://api.xilos.ai on port 443.

Next Steps