NexRouter · Help center
Client integrations

Use NexRouter with OpenClaw

Connect OpenClaw with your site API address, key, and model.

Follow these steps to use your NexRouter key and model in OpenClaw.

Not installed yet? Follow the official guide first, then return here.

1. Get three things ready

Use an address and key from the same site. Domestic and overseas credentials are separate.

2. Configure OpenClaw

Replace these values in the example; do not leave YOUR_... unchanged:

PlaceholderReplace with
YOUR_API_BASE_URLThe OpenAI Base URL including /v1 from connection settings
YOUR_API_KEYThe full API key you copied
YOUR_MODEL_IDThe exact model ID you copied
YOUR_MODEL_NAMEA display name you recognize, or the model ID

After official onboarding, merge these fields into ~/.openclaw/openclaw.json, preserving existing settings:

~/.openclaw/openclaw.json
{
  models: {
    providers: {
      nexrouter: {
        baseUrl: "YOUR_API_BASE_URL",
        apiKey: "${NEXROUTER_API_KEY}",
        api: "openai-completions",
        models: [
          {
            id: "YOUR_MODEL_ID",
            name: "YOUR_MODEL_NAME",
          },
        ],
      },
    },
  },
  agents: {
    defaults: {
      model: {
        primary: "nexrouter/YOUR_MODEL_ID",
      },
    },
  },
}

Keep /v1 in baseUrl. Set NEXROUTER_API_KEY in the launching process environment. For a background service, use a permission-restricted ~/.openclaw/.env and restart the relevant gateway after updating it. Never commit the key file.

export NEXROUTER_API_KEY='YOUR_API_KEY'
openclaw models list
openclaw models set nexrouter/YOUR_MODEL_ID

3. Send a test message

Select the model you just configured, open a new chat, and send:

Please reply with only: Connected

A normal reply means your first connection worked. You can now start your own task.

If no reply arrives, check the error:

  • 401 / API key error: copy the full key again and check that the address and key belong to the same site.
  • 404 / endpoint not found: compare the URL with the format above, especially missing or repeated /v1.
  • Model not found: copy the exact model ID again and check that your key has access.

See Troubleshooting for other errors. To check the API separately, use the first request example.

Learn more

For installation, complete settings, and advanced features, see the official OpenClaw documentation.