Antbase/Documentation

OpenClaw Integration

Connect OpenClaw to ANT for dynamic model routing across all your coding tasks. For the full agent guide with architecture details and troubleshooting, see Agents > OpenClaw.

Automatic Setup

Run this command in your terminal. It will create an Antbase account (or log you in), generate an API key, and configure OpenClaw automatically.

curl -fsSL https://antbase.ai/install.sh | bash

Done!

The installer will detect your openclaw.json and add ANT as a provider.

Manual Configuration

If you prefer to configure OpenClaw manually, add ANT to your ~/.openclaw/openclaw.json:

{
  "providers": {
    "antbase": {
      "baseUrl": "https://antbase.ai",
      "apiKey": "${ANT_API_KEY}",
      "api": "anthropic-messages",
      "models": [
        { "id": "auto", "name": "ANT Auto", "reasoning": true, "input": ["text"], "contextWindow": 200000, "maxTokens": 8192 },
        { "id": "best", "name": "ANT Best", "reasoning": true, "input": ["text"], "contextWindow": 200000, "maxTokens": 16384 },
        { "id": "fast", "name": "ANT Fast", "reasoning": false, "input": ["text"], "contextWindow": 128000, "maxTokens": 4096 },
        { "id": "free", "name": "ANT Free", "reasoning": false, "input": ["text"], "contextWindow": 131072, "maxTokens": 8192 },
        { "id": "reasoning", "name": "ANT Reasoning", "reasoning": true, "input": ["text"], "contextWindow": 200000, "maxTokens": 16384 },
        { "id": "coder", "name": "ANT Coder", "reasoning": true, "input": ["text"], "contextWindow": 200000, "maxTokens": 16384 },
        { "id": "creative", "name": "ANT Creative", "reasoning": false, "input": ["text"], "contextWindow": 200000, "maxTokens": 16384 },
        { "id": "vision", "name": "ANT Vision", "reasoning": false, "input": ["text", "image"], "contextWindow": 128000, "maxTokens": 8192 }
      ]
    }
  }
}

Get your API key from the dashboard and set it in your environment:

export ANT_API_KEY="ant_your-api-key-here"

Usage

Once configured, OpenClaw works exactly as before. ANT handles routing transparently:

# Your existing OpenClaw commands work as before
openclaw chat "How do I implement a binary search?"

# ANT will:
# 1. Classify the prompt (coding, medium complexity)
# 2. Select the optimal model (e.g., DeepSeek V3 for code)
# 3. Stream the response back with routing info in headers

# Switch models per-request:
openclaw -m antbase/free "explain what this regex does"
openclaw -m antbase/best "design the database schema for a multi-tenant SaaS"
openclaw -m antbase/reasoning "prove that sqrt(2) is irrational"

Virtual Models

Use different virtual models for different use cases:

antbase/auto

Balanced routing — ANT picks the best model for each prompt

antbase/fast

Optimized for speed — quick queries, autocomplete

antbase/best

Maximum quality — complex reasoning, architecture

antbase/free

Zero-cost — uses free-tier provider models only

antbase/reasoning

Thinking models — o-series, Claude extended thinking, DeepSeek R1

antbase/coder

Code-optimized — favors high-quality code generation models

antbase/creative

Writing & dialogue — expressive models with good prose quality

antbase/vision

Image-capable — guaranteed to handle screenshots and visual content

Full list of virtual models, weights, and examples: Virtual Models. You can also create custom model groups with Nests.

Troubleshooting

Install script fails

Make sure you have curl installed and can reach antbase.ai. The script will open your browser for authentication.

401 Unauthorized errors

Check that your API key is correct in openclaw.json. You can regenerate keys in the dashboard.

OpenClaw not using ANT

Ensure "defaultProvider": "antbase" is set in your config, or use the -p antbase flag.

For more troubleshooting help, see the full OpenClaw agent guide.