Skip to main content

Integration Guide

OpenRouter + WHMCS

Use 500+ AI models with your WHMCS billing data

Estimated time: 15 minutes · Transport: SSE · 24+ free models available

Quick Reference

Transport
SSE via OpenRouter API
Public URL
Required
Models
500+ (24+ free)
Avg Response Time
2-6 seconds (includes ~25ms OpenRouter overhead)

How OpenRouter + MCP Server work together

OpenRouter provides AI models. MCP Server provides WHMCS tools. They are separate connections configured in your AI client. OpenRouter does not connect to WHMCS directly. Your AI client (OpenClaw, Goose, or another multi-model tool) orchestrates both.

Prerequisites

  • WHMCS 8.0 or higher with admin access
  • MCP Server addon installed and activated (installation guide)
  • An OpenRouter account with credits (minimum $5)
  • A multi-model AI client (OpenClaw, Goose, or similar)

Step 1: Generate a Bearer Token

  1. Go to your WHMCS admin panel
  2. Navigate to Addons > MCP Server
  3. Click Generate New Credential
  4. Name your credential and set permissions based on your use case
  5. Copy the Bearer token (shown only once). You will need it in step 3.

Step 2: Get an OpenRouter API Key

  1. Go to openrouter.ai and create an account
  2. Navigate to API Keys in your dashboard
  3. Click Create Key
  4. Add credits (minimum $5, 5.5% fee included)
  5. Copy the API key. This goes in your AI client's LLM configuration.

Tip: Start with $5 in credits. If you use free models for simple queries, $5 lasts a long time. You can always add more later.

Step 3: Configure Your AI Client

Your AI client needs two configurations: OpenRouter for models and MCP Server for WHMCS tools.

MCP Server configuration (for WHMCS access):

{
  "mcpServers": {
    "whmcs": {
      "command": "npx",
      "args": ["-y", "mcp-remote",
        "https://your-whmcs.com/modules/addons/mx_mcp/mcp.php",
        "--header", "Authorization:Bearer your-bearer-token-here"]
    }
  }
}

OpenRouter LLM configuration:

The LLM configuration varies by AI client. In general, set the base URL to https://openrouter.ai/api/v1 and use your OpenRouter API key. Select the model you want (e.g., anthropic/claude-sonnet-4-20250514 or deepseek/deepseek-r1).

Step 4: Test the Connection

  1. Start your AI client with both OpenRouter and MCP Server configured
  2. Type: Get WHMCS system status
  3. Verify the model responds with WHMCS system information
  4. Try switching models to compare speed and quality for the same query

Success! If you see WHMCS data, both connections are working. Try a free model for simple queries and a premium model for complex analysis to see the cost difference.

Troubleshooting

AI responds but no WHMCS data

  • The OpenRouter connection works but MCP Server is not configured. Check your MCP Server config.
  • Verify the MCP Server API key is correct and the addon is activated in WHMCS.
  • Ensure your WHMCS URL is reachable from your machine (HTTPS required).

Model not responding or very slow

  • Free models on OpenRouter may have higher latency during peak times
  • Check your OpenRouter credits balance (empty balance blocks requests)
  • Try a different model to rule out provider-specific issues
  • OpenRouter adds ~25ms overhead, but total query time depends on the model

MCP tools not appearing

  • MCP Server and OpenRouter are separate connections. MCP tools come from MCP Server, not OpenRouter.
  • Restart your AI client after adding the MCP Server configuration
  • Check that Node.js and npx are installed (needed for the mcp-remote bridge)

Upgrading from v1.1.x?

If you set up the MCP Server before v1.3.0, the authentication method changed. Here is what is different and how to update your config.

Previous method (v1.1.x)

Still works. In v1.3.0, authentication changed from API Keys to Bearer tokens, and the endpoint changed from sse.php to mcp.php. If you are still on v1.1.x, this is how it was configured:

{
  "mcpServers": {
    "whmcs": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-remote",
        "https://your-whmcs.com/modules/addons/mx_mcp/mcp/sse.php"],
      "env": { "MCP_API_KEY": "your-api-key-here" }
    }
  }
}

To upgrade: update the config to use mcp-remote (not @anthropic/mcp-remote), change sse.php to mcp.php, and replace the MCP_API_KEY env var with a --header Authorization:Bearer YOUR_TOKEN arg.

Next Steps