mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-09 02:54:37 +00:00
EHBP response bodies are opaque encrypted blobs, so cost cannot be injected into JSON like the normal proxy flow. Instead, surface cost as response headers: X-Routstr-Cost-Msats — total msats charged (bearer + x-cashu) X-Routstr-Cost-Usd — USD equivalent (bearer only) X-Routstr-Input-Cost-Msats — msats attributed to input tokens X-Routstr-Output-Cost-Msats— msats attributed to output tokens - Refactor _compute_ehbp_actual_cost from int→dict to carry full cost breakdown - Add _build_cost_info() and _inject_cost_response_headers() helpers - Capture adjust_payment_for_tokens return in bearer path (was discarded) - Update CORS expose_headers, docs, and unit tests