---
title: "Optimization"
description: "Strategies for reducing agent costs without sacrificing capability. The biggest cost saver is the Broker Routing engine. Instead of sending every task to an LLM, the broker tries cheaper options first: Enable broker rout"
resource: https://www.aiagents.nexus/docs/cost-control/optimization
generated: { by: "process:nexus-agent-assets", at: 2026-09-07T09:13:03Z }
status: stable
---

# Cost Optimization

Strategies for reducing agent costs without sacrificing capability.

## Broker Routing

The biggest cost saver is the Broker Routing engine. Instead of sending every task to an LLM, the broker tries cheaper options first:

```
Task → Skill Match (free) → WASM Handler ($0.001) → LLM ($0.03+)
```

Enable broker routing:

```yaml
broker:
  enabled: true
  routing:
    preferSkill: true
    llmAsLastResort: true
```

## Cost Savings Breakdown

| Route | Avg Cost | Speed |
|---|---|---|
| Skill match | $0.00 | <1ms |
| WASM handler | ~$0.001 | ~10ms |
| LLM fallback | ~$0.03 | ~2s |

With broker routing enabled, typical projects see **40-60% cost reduction**.

## Caching

Enable response caching to avoid duplicate LLM calls:

```yaml
broker:
  cache:
    enabled: true
    ttl: 3600    # cache for 1 hour
```

## Right-Sizing Budgets

Use the dashboard to analyze actual spending patterns:

```bash
naos dashboard --open
```

Navigate to the Cost page to see:
- Per-agent spending over time
- Peak usage periods
- Budget utilization rates

## Tips

1. **Start with generous budgets** and tighten based on actual usage
2. **Use skill handlers** for repetitive tasks (summarize, classify, extract)
3. **Enable caching** for idempotent operations
4. **Monitor the dashboard** weekly to identify optimization opportunities
5. **Use throttle instead of pause** to maintain availability at reduced capacity
