Resonance Lattice · Docs

API keys

An API key is not a prerequisite for anything rlat can do. Almost everything runs on your machine with no key and no internet, and every LLM-driven loop runs free on your Claude subscription as an in-session skill. The key buys exactly one thing: running those same loops unattended through the CLI.

01 — When you need one

What needs a key

Most commands — rlat build, rlat search, rlat profile, rlat compare, rlat summary, rlat refresh, rlat sync, rlat freshness, rlat convert, rlat skill-context, and most of rlat memory — need no API key, no internet, and no LLM.

The commands below call Claude Sonnet 4.6 through the Anthropic API. They are advanced, opt-in features for users who want a programmatic surface; everyone else gets the equivalent value through Claude-Code-driven skills at no extra cost.

CommandWhat it doesWhy it needs an LLM
rlat deep-search Runs a multi-hop research loop (plan → retrieve → refine → synthesize) and returns a faithfully-grounded answer with cited evidence. Calls Sonnet 4.6 for the planner / refiner / synthesizer hops.
rlat reverify Re-judges stale insights against their changed source — survivors revive, failures retire. Asks Sonnet whether the updated source still supports each insight.
rlat probe Idle-cycle self-probe — re-attempts queries that previously failed to ground. Runs deep-search internally on each weak-zone query.
rlat grow One opt-in self-improvement pass — reads the archive's own usage telemetry, finds the most-demanded, worst-covered gaps, and authors a grounded fill for each. Calls Sonnet to author each fill; the faithfulness gate decides whether it lands. --dry-run previews the candidates with no LLM and no writes.
rlat memory verify Checks high-criticality memory claims against a corpus knowledge model — confirmed claims rise to verified, contradicted ones drop to low. Asks Sonnet whether the corpus supports each claim. The rest of rlat memory — capture, recall, consolidate, add — is key-free.
rlat intent decompose Breaks a declared task intent into mechanical step children. Asks Sonnet for the decomposition; without a key it refuses with a clear message. The rest of rlat intent is key-free.

Three opt-in features degrade gracefully instead of erroring: passive world-fact mining (RLAT_MINE_ATTRIBUTES=1, set by rlat memory install-hooks --mine) and atomic event extraction (RLAT_ATOMIC_CAPTURE=1) add LLM steps to the session-end capture hook — each activates only when a key resolves, and without one the hook stays silent and capture falls back to its key-free path. rlat intent what-next likewise uses an LLM to phrase its recommendation when a key is present and falls back to a plain top-candidate readout without one.

An insight is an earned, cited summary the knowledge model stores alongside the raw source passages — see the claim system page for the full model. The LLM-driven commands above all touch that layer or synthesise answers from it.

02 — The free path

Every loop runs two ways

Each LLM-driven loop ships with a bundled Claude Code skill that runs it on the subscription you already have — no key, nothing metered. The skill path has two real advantages: it runs on your assistant's own model (typically a stronger model than a budget API call), and it keeps you in the loop — the skills confirm with you before anything lands in the file. The API path wins when you want the loop unattended: automation, CI, scheduled runs — and it is cheap there (rlat deep-search ≈ $0.009/question).

The loopFree, on your subscriptionUnattended, with a key
Deep research over a knowledge model deep-research skill — the same loop (same prompts, hop budget, name-verification, output shape), driven in-session. What most users should use. rlat deep-search
Teach the file your world (capture) rlat-learn skill — say "remember this"; the assistant applies the same four capture gates (including the privacy gate), you approve every fact, and it lands via the key-free rlat capture-attribute. The background hook (rlat memory install-hooks --mine) mines facts at session end, unattended.
Curate and grow the corpus Four skillsrlat-gap-scan, rlat-contradictions, rlat-refresh-facts, rlat-curate — run the whole detect → judge → fetch → land loop with you as the authority (user-vouched facts seed at the highest trust tier). rlat grow authors gap fills unattended, gated on faithfulness.
Re-check stale or weak spots No dedicated skill — but an assistant session does it directly: read the stale claim and its updated source, judge, then correct via the key-free surfaces. rlat reverify, rlat memory verify, rlat probe (idle-cycle — unattended by nature).

One more zero-LLM option covers most factual lookups outright: single-shot rlat search --format context — the benchmark shows 76.5% answerable accuracy at 3.9% hallucination on the Microsoft Fabric corpus, versus 92.2% / 0% for the deep loop.

Note

The subscription path is not a degraded mode. In this project's own benchmark program the in-session (subscription) judges were the pre-registered primary; the budget API judge was the cross-check — and it was the lenient one on borderline calls (the judge-sensitivity notes on the benchmarks page).

03 — Getting a key

Getting an Anthropic API key

If you decide you want a key for one of the opt-in commands:

Cost estimates

CommandTypical cost
rlat deep-search~$0.009–0.025 per question; a 4-hop loop on a typical question is ~$0.012.

If those numbers are higher than you want, the in-session skill alternatives above are free and the benchmark data shows they reach the same quality ceiling.

04 — Setting the key

Setting the key in your environment

rlat looks up the key in this order:

OrderVariableNotes
1RLAT_LLM_API_KEY_ENV The name of another environment variable that holds the key. Use this when your secrets manager stores the key under a different name.
2CLAUDE_API_2 The active key slot for the harness LLM in this project; checked first of the direct names.
3CLAUDE_API The legacy canonical name; still supported.
4ANTHROPIC_API_KEY Anthropic's standard variable name; supported for compatibility with their other tooling.

If none of those is set, rlat also falls back to Kaggle secrets (so notebook builds work). Set whichever variable fits your workflow.

Linux / macOS (bash, zsh)

export CLAUDE_API="sk-ant-..."
# Persist by adding the line to ~/.bashrc, ~/.zshrc, or your shell rc file.

Windows PowerShell (current session only)

$env:CLAUDE_API = "sk-ant-..."

Windows PowerShell (persistent across sessions)

[System.Environment]::SetEnvironmentVariable("CLAUDE_API", "sk-ant-...", "User")
# New PowerShell sessions will see it; the current session still needs:
$env:CLAUDE_API = [System.Environment]::GetEnvironmentVariable("CLAUDE_API", "User")

.env file (development)

If you use direnv or a .env file loaded by your shell:

CLAUDE_API=sk-ant-...
Don't commit secrets

Never commit a .env file that contains a key. .gitignore should already exclude it.

From a secrets manager (production / CI)

In a CI pipeline or hosted environment, fetch the key from your secrets manager and export it as CLAUDE_API — or set RLAT_LLM_API_KEY_ENV to indirect through whatever name the manager uses:

# Example: AWS Secrets Manager
export CLAUDE_API="$(aws secretsmanager get-secret-value \
  --secret-id anthropic/api-key --query SecretString --output text)"
rlat deep-search project.rlat "$question"
05 — Verify & control cost

Verification

Once the key is set, confirm rlat can see it:

rlat deep-search myproject.rlat "test question" --max-hops 1

If you see error: An LLM API key is required for this command, the key is not in any of the variables rlat checks. Re-run echo $CLAUDE_API (Linux / macOS) or echo $env:CLAUDE_API (PowerShell) to confirm — the value should start with sk-ant-.

Cost guardrails

rlat deep-search reports the cost in its output so you can track spend per question:

[deep-search] hops=4 in=2143 out=312 cost=$0.0118 evidence=8 passages
06 — Background

Why isn't deep-search free in the CLI too?

Because the CLI verb is a separate process — it cannot reach into a running Claude Code conversation to use your subscription. When you run rlat deep-search from a shell, it spawns Python, loads the knowledge model, and needs a way to call an LLM for the planner / refiner / synthesizer hops. Today that is the Anthropic API.

A future option is an rlat deep-search --llm-server <url> flag pointing at a local LLM (Ollama, llama.cpp) so the CLI can use whichever LLM you already have. Until then, the deep-research skill is the answer — the same loop, no extra cost, no API key.

What's next