Routing Studio lets you bias Theo’s routing engine for your domain. The SDK exposes three namespaces:Documentation Index
Fetch the complete documentation index at: https://docs.hitheo.ai/llms.txt
Use this file to discover all available pages before exploring further.
theo.routingPreferences— shared preference objects (one rule set, many keys).theo.routingRules— per-key rule editing without an explicit preference object.theo.keys.getRoutingPreference/setRoutingPreference— bind a shared preference to a key.
Shared preferences
List
Get
Create
scope: "team" requires an active org and the team-config permission. Idempotent via the Idempotency-Key header.
Update
rules or examples replaces the entire collection.
Delete
Cascade-removes every key binding pointing at the preference.Test (replay against the routing engine)
Replays a prompt twice — once without the preference (baseline) and once applied — so you can render a side-by-side diff.routing telemetry your callers receive on a real completion.
Per-key routing rules
The preference-free shortcut: the server find-or-creates a hidden per-key preference under the hood and ensures the binding row points at it. Reach for this when you’re tuning a single key.Get
Effective
The snapshot that will actually drive completions for the key right now, plus asource enum so you can render inherited context.
Set
Replaces the per-key rules / examples / overrides and ensures the binding points at the hidden row.Clear
Drops the binding (the key falls back to org default → user default → none) and deletes the hidden preference row. Existing bindings to a shared preference are left alone.Key bindings (shared preferences)
Bind an existing shared preference to a key, or clear the binding.Types
The SDK exports first-class types for every shape —switch and if blocks narrow without as any:
RoutingPreferenceSummary— full preference row.RoutingRuleInput— single keyword/regex rule (pattern,target_mode, optionaltarget_engine,confidence, optionaldescription).RoutingExampleInput— few-shot example (prompt,expected_mode, optionalexpected_engine).RoutingPreferenceTestResult—{ baseline, with_preference }envelope returned bytest.KeyRoutingRulesSnapshot— per-key snapshot withactive+shared_binding.KeyEffectiveRouting— effective routing snapshot with thesourceenum.
Telemetry
When a preference contributes to a completion’s routing decision, themeta and done SSE events surface a customer_preference block:
meta event’s routing field to render the same affordance in your product.