5.6 KiB
API Coverage — Routstr
Full coverage by default. Opt-outs are explicit, reasoned decisions. Produced at plan time (2026-08-03) for Phase 13, per D-04 ("Routstr is explicitly in scope at the user's request").
Confidence caveat, stated up front:
13-RESEARCH.mdrates the Routstr protocol MEDIUM confidence — every row below is derived fromdocs.routstr.comand has never been run against a live provider. Open Question 3 asks for a spike; plan 13-03 is that spike. Rows markedINTEGRATE — UNCONFIRMEDare ones this matrix cannot yet vouch for. 13-03 Task 2 rewrites this file from what the live relay/provider actually returns.
Scope note
Routstr is the only genuinely new external integration in this phase. Anthropic's Messages
API and Ollama's HTTP API are already partially in-tree (mesh/listener/assist.rs::call_claude
/ call_ollama) and are extended, not integrated from scratch — they get no matrix.
Capability matrix
| capability | decision | reason |
|---|---|---|
POST /v1/chat/completions — non-streaming |
INTEGRATE | The loop's only required call shape. Every turn where a tool may be emitted must be fully buffered (AI-SPEC §4b.2), so non-streaming is the primary mode, not a fallback. |
Tool / function calling (tools[] request, tool_calls[] response) |
INTEGRATE — UNCONFIRMED | Required for D-07 parity: the confirm gate must behave identically on Routstr. OpenAI-compat convention says tool_calls[].function.arguments is a JSON-encoded string (unlike Ollama/Claude's parsed object) — AI-SPEC §3 Pitfall 2. Not confirmed against a live provider. 13-03 must settle it before backends/routstr.rs is written. |
Cashu payment attach (Authorization: Bearer cashuA… and/or X-Cashu:) |
INTEGRATE — UNCONFIRMED | D-04/D-05 make paid inference the point of the integration. Two header spellings are documented; the spike determines which the live provider accepts, and the client must not guess. |
Provider discovery over Nostr (kind 38421) |
INTEGRATE — UNCONFIRMED | D-04 says providers/models/prices are "discovered over Nostr". Reuses nostr_discovery.rs::build_nostr_client (Tor-aware). Event kind, d tag value and content schema are all cited-not-verified. |
Model listing (from the discovered provider event / GET /v1/models) |
INTEGRATE | Routstr's model id is not a constant in this codebase — it comes from the provider. Without listing there is nothing to select. |
| Price listing (sats per model, from the provider event) | INTEGRATE | D-05's budget ceiling is arithmetic over a price. auto_pay_token(…, price_sats) cannot be called without one. |
| Provider selection strategy among multiple advertised providers | INTEGRATE | Explicitly delegated to Claude's discretion in CONTEXT.md. Implemented as: cheapest advertised price for the requested model that is affordable under the remaining PaymentPolicy budget, preferring an onion endpoint when Tor is up. |
| Balance / refund endpoint (change from an overpaying Cashu token) | INTEGRATE | Ecash payments overpay by construction when denominations do not divide evenly. Discarding change silently burns the owner's money — unacceptable in a self-custody product. If the live provider returns no change mechanism, 13-03 records that and this row flips to a named residual loss. |
Streaming (stream: true / SSE) |
OPT-OUT | A turn that may emit tool calls cannot be structurally validated mid-stream (AI-SPEC §4b.2), and Routstr is the tertiary backend reached only when Ollama and Claude are unavailable — the tier where perceived-latency polish matters least. Revisit only if Routstr becomes a common path. |
| Prompt caching / cache_control | OPT-OUT | Provider-specific and undocumented for Routstr; the Anthropic-side equivalent is already flagged as a follow-up optimization in AI-SPEC §4b.5, not a phase requirement. No correctness or safety property depends on it. |
Embeddings / /v1/embeddings |
OPT-OUT | This phase has no retrieval and no grounding corpus (AI-SPEC §5 rules RAGAS "NOT APPLICABLE" for the same reason). Nothing in D-01..D-18 needs an embedding. |
| Image / vision inputs | OPT-OUT | AIUI's chat surface in embedded mode sends text; no locked decision introduces image input. Adding it would widen the untrusted-content surface D-10 governs without a requirement asking for it. |
Running a Routstr provider (routstrd, selling inference from this node) |
OPT-OUT | Out of the phase boundary — the phase makes the node a consumer of inference. Selling inference is a distribution/payments feature in the same family as the deferred "archipelago content source" (D-14). |
| Routstr's own Nostr-based auth / NIP-98 style request signing (if any) | OPT-OUT | Not documented as required for the Cashu-paid path, which is the only path D-04/D-05 authorize. If 13-03 finds it is mandatory, this row flips to INTEGRATE and 13-13 absorbs it — that reversal is exactly what the spike exists to catch. |
Opt-out audit
Every OPT-OUT row above carries a one-line reason. Six opt-outs, six reasons. No row is
marked INTEGRATE on confidence this matrix does not have — the three genuinely uncertain
capabilities are marked INTEGRATE — UNCONFIRMED rather than laundered into a clean
INTEGRATE.
Gate
13-13 (Routstr backend + D-05 budget ceiling) must not begin until 13-03 has replaced
the three UNCONFIRMED rows with live-observed facts, or has recorded that no live provider
was reachable — in which case 13-13's own first task is a checkpoint:decision on whether to
ship a docs-only client or defer the Routstr leg of D-04 with a named residual.