Skip to main content
Megan turns the Cadenza CLI into an API you call from your own code. Your sign-in token doubles as an API key, and a tiny SDK — from cadenza_cli import MeganTK — lets any project drive the hosted megan-tk governance directly. No server to run, no model to download, no Supabase credentials.
megan-tk is Cadenza’s symbolic governance token. It watches a task unfold and returns one thing: a decisionkeep going or adapt here. It is the torch-free “should I act, and where?” brain that sits above your policy; your own change-doer acts on its verdict.

What it gives you

Token sessions

Give the token an objective and an ordered chain of milestones. Report what you’ve reached (or what’s blocking), and it tells you whether to continue or adapt, and at which milestone.

Disturbance anticipators

Feed it the times a periodic disturbance hits. It learns the rhythm and, at any moment, tells you whether to protect now and which registered action is best.

Metered usage

Every call is counted server-side against your account. Read it back with cadenza usage or tk.usage() — per-route counts plus a session/anticipator rollup.

Zero-dependency SDK

The client is standard-library only — no torch, no extras. Drop it into a lightweight project and call the API.

Two ways to reach it

PathUse it when
SDKfrom cadenza_cli import MeganTKYou’re building an application or control loop and want to call megan-tk from code.
CLIcadenza apikey, cadenza usageYou want your API key to paste elsewhere, or to inspect what you’ve consumed.
from cadenza_cli import MeganTK

tk = MeganTK(api_key="<your-token>")          # or MeganTK() to auto-resolve it

with tk.session("pick up the red cube", ["reach", "grasp", "lift"]) as s:
    d = s.step(reached=[0], obstacles=[{"id": "wall", "milestone": 1}])
    if d.adapt:                                # the token wants you to act
        handle(d.frontier)                     # ...at this milestone

The locked contract

megan-tk deliberately returns only the actionable decision — never the internals it used to reach it.
Responses carry route + frontier (sessions) and should_protect + best_action + ready (anticipators) — and nothing else. The progress metric, stall counters, the blocked flag, the rule text, the reasoning trace, and an anticipator’s learned period / phase / confidence all stay on the server. The routes are also rate-limited per account so the decision boundary can’t be reconstructed by mass probing.
This is a feature, not a limitation: you integrate against a stable, minimal decision surface, and the valuable mechanism can’t leak out of a response.

When to use Megan

  • You have a policy (scripted, learned, or a VLA) and want a governor that decides when it should deviate from plan and where.
  • You need anticipatory safety against a recurring disturbance without hand- tuning timing.
  • You want to consume Cadenza’s reasoning from an external project rather than inside the env mission workflow.

Next

Setup

Install the SDK, get your key, make your first call.

Build deep

Wire the token into a real control loop with the change-doer pattern.