AI Model Routing

ClawTrust automatically routes different tasks to different AI models, so you get full power for conversations and cost savings on background work.

How it works

Model routing is automatic. You pick your primary model in the dashboard, and ClawTrust handles the rest at the platform level.

You select your preferred model in the dashboard (Settings > AI Model)
ClawTrust deploys a config to your agent with a 3-tier model setup
Your primary model handles all direct conversations
Background tasks (heartbeats, sub-agents) automatically use the cheapest reliable model
If your primary model is unavailable, the fallback chain kicks in automatically

What runs on which model

Each type of agent activity is routed to the most cost-effective model for that task.

Conversations with you

Your selected model (e.g. Claude Opus 4.6)

Config: model.primary

Heartbeat checks (every 30 min)

Claude Haiku 4.5 (cheapest available)

Config: heartbeat.model

Sub-agent tasks

Claude Haiku 4.5 (cheapest available)

Config: subagents.model

Failover (primary unavailable)

Cascades through fallback chain

Config: model.fallbacks

Cost impact

Smart routing saves significant AI budget by matching model power to task complexity.

Heartbeat savings

Haiku heartbeats cost ~$0.004 per cycle vs $0.082 on Opus. That is roughly 20x cheaper for the same inbox check.

Sub-agent savings

Background tasks like file organization and memory synthesis run on Haiku, keeping your primary budget for real work.

Full power when it matters

Direct conversations, complex analysis, and strategy tasks always use your selected primary model at full capability.

Automatic failover

If your primary model has an outage, the fallback chain switches to the next best model with zero downtime.

Bring Your Own Key (BYOK)

Connect your own API keys for additional providers. Your keys are never stored on the agent VPS.

Anthropic (Claude Pro/Max subscription or API key)

Native Anthropic routing. No OpenRouter middleman, faster responses.

OpenAI (GPT-5.2, GPT-4.1, o3-mini)

Use OpenAI models directly with your own API key and billing.

Google AI (Gemini 2.5 Flash, Gemini 3)

Direct Google AI access with your own rate limits and billing.

MiniMax (M2.5)

Ultra-low-cost option for high-volume tasks.

Security: BYOK keys are encrypted in our database and decrypted only by a Cloudflare Worker proxy at request time. Your agent authenticates with a platform token and never sees the real API key. See our Security Architecture docs for details.

Fallback chain

If your primary model is unavailable, the agent automatically tries the next model in the chain. No downtime, no manual intervention.

With Anthropic subscription:

Your primaryClaude Sonnet 4.6Claude Sonnet 4.5Claude Haiku 4.5

With OpenRouter (included budget):

Your primaryBYOK fallbacks (if connected)Claude Haiku 4.5Llama 3.3 70BGemini 2.0 Flash

Common questions

Things customers ask about model routing.

Can my agent switch models mid-conversation?

No. This is an OpenClaw limitation, not a ClawTrust restriction. OpenClaw (the open-source agent runtime) only allows the configured primary model for active sessions. This is a security measure in OpenClaw itself that prevents prompt injection from downgrading to a weaker model. ClawTrust does not add any additional model restrictions beyond what OpenClaw enforces.

Can I tell my agent to use Haiku for heartbeats in its instructions?

You don't need to. ClawTrust configures this at the OpenClaw config level, which takes priority over agent instructions. Adding model routing to HEARTBEAT.md or AGENTS.md has no effect. OpenClaw reads the heartbeat model from its config file, not from the agent's markdown files.

Does the dashboard model selector affect heartbeats?

No. The model you pick in the dashboard only sets the primary model for direct conversations. Heartbeats and sub-agents always use the cheapest available model (Haiku if you have Anthropic, otherwise the cheapest BYOK or OpenRouter option).

What happens if my OpenRouter budget runs out?

If you have BYOK providers connected (Anthropic, OpenAI, Google), the fallback chain tries those first. BYOK providers use your own API key with no ClawTrust budget limit. This means connecting a BYOK key acts as insurance against budget exhaustion.

How do I change my primary model?

Go to your agent detail page and click Settings > AI Model. Pick from the available models. The change takes effect within a few seconds as ClawTrust pushes the new config to your agent.

Directing your agent

What you can control vs. what ClawTrust handles automatically.

You control (Dashboard)

  • Which primary model your agent uses
  • Which BYOK provider keys are connected
  • Your OpenRouter AI budget allocation

ClawTrust handles automatically

  • Routing heartbeats to the cheapest reliable model
  • Routing sub-agents to cost-effective models
  • Building the fallback chain based on connected providers
  • Failing over to backup models on outages

ClawTrust vs OpenClaw: who does what

OpenClaw is the open-source agent runtime. ClawTrust is the managed hosting platform. Here is exactly what each layer controls.

ClawTrust (managed platform)

  • Generates the OpenClaw config with 3-tier model routing
  • Validates model selection against the provider allowlist
  • Deploys config to VPS via secure config push
  • Encrypts and proxies BYOK API keys (agent never sees them)
  • Sets heartbeat and sub-agent models to cheapest available
  • Does NOT restrict which models OpenClaw can use at runtime

OpenClaw (agent runtime)

  • Reads the config file at startup
  • Routes heartbeats to the configured heartbeat model
  • Routes sub-agents to the configured sub-agent model
  • Uses fallback chain when the primary model fails
  • Blocks mid-session model switching (security measure)
  • This is an OpenClaw design decision, not a ClawTrust restriction

Ready to hire your first AI employee?

Production-ready in 5 minutes. All 7 security layers included on every plan.