diff --git a/strix/interface/cloud/runner.py b/strix/interface/cloud/runner.py index c4f461e3..57b7ced3 100644 --- a/strix/interface/cloud/runner.py +++ b/strix/interface/cloud/runner.py @@ -371,8 +371,17 @@ def _topup( return http.EXIT_PAYMENT url = f"{http.app_url()}/api/v1/billing/topup" - auth_header = f"Authorization: Bearer {http.api_token(token)}" - command = [npx, "--yes", "mppx", url, "-J", json.dumps(body), "-H", auth_header] + auth_header = f"X-Strix-Authorization: Bearer {http.api_token(token)}" + command = [ + npx, + "--yes", + "mppx", + url, + "-J", + json.dumps(body), + "-H", + auth_header, + ] payment_method = getattr(args, "payment_method", None) or os.environ.get( "MPPX_STRIPE_PAYMENT_METHOD" ) diff --git a/tests/test_cloud_cli.py b/tests/test_cloud_cli.py index 820a30b5..2f03d75b 100644 --- a/tests/test_cloud_cli.py +++ b/tests/test_cloud_cli.py @@ -320,6 +320,8 @@ def test_topup_passes_payment_method_to_wallet(monkeypatch: pytest.MonkeyPatch) ["billing", "topup", "--credits", "5", "--yes", "--payment-method", "pm_card_visa"] ) assert code == 0 + assert "X-Strix-Authorization: Bearer tok" in commands[0] + assert "Authorization: Bearer tok" not in commands[0] assert "-M" in commands[0] assert "paymentMethod=pm_card_visa" in commands[0]