Brain · Ask with your own key

Ask your tools with your own key

Ask a plain-language question about your own usage, and get a grounded answer. In Brain, Ask the brain, switch to Telemetry mode. A deterministic resolver answers metric questions for free. Anything it cannot match runs a bounded tool loop over your telemetry, on your own Anthropic key, so the reasoning happens on your account and nowhere else.

Where it runs

Open Ask the brain (Brain), then flip the mode toggle from Brain to Telemetry. Brain mode searches your brain and docs markdown. Telemetry mode runs analytics over your usage aggregates and posts to POST /api/brain/ask/telemetry.

Your key, your loop

The tool loop calls Anthropic with your key. Set ANTHROPIC_API_KEY in Settings under BYOK (stored in the RepoOps data-dir .env, never in git), or as an environment variable. The loop is bounded on purpose:

  • Up to 6 tool calls per question, a per-call token cap, and a shared per-day token cap.
  • Narrow, read-only tools over your aggregates: telemetry rollups and daily series, spend-to-outcome, session signals, tool and MCP inventory, Billing Guard, spend efficiency, app LLM calls, and spend by topic.
  • It runs on Claude Sonnet by default, with a Haiku cheap mode you can flip on.
  • Only ANTHROPIC_API_KEY is read here. OpenAI and OpenRouter keys are not used by this loop (they drive BYOK embeddings, a separate feature).

Free path, then paid path

The deterministic resolver runs first and short-circuits before any model call, so a metric question costs nothing and badges deterministic resolver, zero LLM cost. A question the resolver cannot answer runs the tool loop and badges BYOK tool loop with the model and the number of tool calls it used. Every model call the loop makes is recorded into your own AI-calls telemetry (surface repoops-chat), so the spend shows up on the same surfaces it reports on.

Without a key

  • A question that needs the loop returns 503 with a hint to paste your Anthropic key in Settings under BYOK, then ask again.
  • Deterministic metric questions keep working with no key.
  • If the shared daily token cap is spent, the loop returns 429 until the next day.

Read more