You are now equipped with Reivo, a cost optimization and protection layer for AI API calls.
Reivo is a transparent proxy that sits between your agent and the LLM provider. It:
The guardrail engine is open source: reivo-guard (TypeScript + Python).
The user's Reivo API key is available as $REIVO_API_KEY.
Proxy base URLs (use these instead of direct provider URLs):
https://proxy.reivo.dev/openai/v1https://proxy.reivo.dev/anthropic/v1https://proxy.reivo.dev/google/v1betaDashboard: https://app.reivo.dev
When the user asks about costs, budgets, or Reivo, use the following:
When the user asks "how much am I spending?", "show costs", "cost report", or similar:
bash
curl -s -H "Authorization: Bearer $REIVO_API_KEY" \
"https://app.reivo.dev/api/v1/overview?days=7"
Present the response as:
When the user asks "budget status", "am I safe?", "loop status", or similar:
bash
curl -s -H "Authorization: Bearer $REIVO_API_KEY" \
"https://app.reivo.dev/api/v1/defense-status"
Present as:
When the user asks "how can I save?", "optimization tips", "reduce costs", or similar:
bash
curl -s -H "Authorization: Bearer $REIVO_API_KEY" \
"https://app.reivo.dev/api/v1/optimization"
Present each tip with severity, description, and estimated savings. Tips include:
When the user says "set budget to $50", "limit spending", or similar:
bash
curl -s -X POST \
-H "Authorization: Bearer $REIVO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"budgetLimitUsd": 50}' \
"https://app.reivo.dev/api/v1/settings"
Confirm the budget was set and explain that requests will be blocked once the limit is reached.
When the user says "remove budget", "clear limit", or similar:
bash
curl -s -X POST \
-H "Authorization: Bearer $REIVO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"budgetLimitUsd": null}' \
"https://app.reivo.dev/api/v1/settings"
When the user says "aggressive mode", "quality mode", or "change routing":
bash
curl -s -X POST \
-H "Authorization: Bearer $REIVO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"routingMode": "aggressive"}' \
"https://app.reivo.dev/api/v1/settings"
Modes: aggressive (maximize savings), balanced (default), quality (prefer original model).
When the user says "set up Slack", "notify me on Slack", or similar:
bash
curl -s -X POST \
-H "Authorization: Bearer $REIVO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"slackWebhookUrl": "https://hooks.slack.com/services/..."}' \
"https://app.reivo.dev/api/v1/settings"
Provider keys should be managed via the dashboard for security:
Add or rotate provider keys at: https://app.reivo.dev/settings
Keys are encrypted at rest and never exposed in API responses (shown masked, e.g.
sk-abc1...xyz9). For maximum security, create limited-scope or project-scoped keys dedicated to Reivo.
To list currently configured keys:
bash
curl -s -H "Authorization: Bearer $REIVO_API_KEY" \
"https://app.reivo.dev/api/v1/provider-keys"
When the user asks "which agent costs the most?", "cost by agent", or similar:
bash
curl -s -H "Authorization: Bearer $REIVO_API_KEY" \
"https://app.reivo.dev/api/v1/agents?days=30"
Present agent-by-agent and model-by-model cost breakdown.
When the user asks "monthly report", "this month's spending", or similar:
bash
curl -s -H "Authorization: Bearer $REIVO_API_KEY" \
"https://app.reivo.dev/api/v1/overview?days=30"
When the user says "open dashboard", "show dashboard", or "I want more detail":
Reivo Dashboard: https://app.reivo.dev
Sign in to see interactive cost charts, session replays, loop detection history, and optimization recommendations.
If the user hasn't set up Reivo yet, guide them:
Sign up at https://app.reivo.dev
Generate an API key in Settings (format: rv_...)
Set the environment variable: bash
export REIVO_API_KEY="rv_your_key_here"
Add provider keys via the dashboard at https://app.reivo.dev/settings (recommended for security — keys are encrypted at rest)
Route API calls through the proxy by changing the base URL in your provider config.
For OpenClaw specifically, update the provider configuration:
json
{
"providers": [
{
"name": "openai",
"apiKey": "${REIVO_API_KEY}",
"baseUrl": "https://proxy.reivo.dev/openai/v1"
},
{
"name": "anthropic",
"apiKey": "${REIVO_API_KEY}",
"baseUrl": "https://proxy.reivo.dev/anthropic/v1"
}
]
}
The proxy forwards your requests to the real provider using the provider key you registered. Your original API keys never leave the Reivo server.
Want guardrails without the proxy? Use reivo-guard directly:
bash
pip install reivo-guard # Python
npm install reivo-guard # TypeScript
reivo-guard provides budget enforcement, loop detection, anomaly detection, and more — all open source (MIT). The managed Reivo service adds smart routing, a dashboard, and Slack notifications on top.
Reivo stores only: model name, token counts, cost, latency, timestamp, session/agent IDs, prompt hash (irreversible).
rv_...xxxx (last 4 chars)