Skip to content

Sats cost (cost_sats) not returned in x-cashu mode #416

@sh1ftred

Description

@sh1ftred

Problem

When using x-cashu mode, the cost_sats field is not returned in the usage response, even though it is returned in other payment modes.

Observed Behavior

The usage object includes cost in USD (via cost: 0.00025998) and cost details, but no cost_sats field:

{
  "usage": {
    "prompt_tokens": 1137,
    "completion_tokens": 111,
    "total_tokens": 1248,
    "cost": 0.00025998,
    "is_byok": false,
    "prompt_tokens_details": {...},
    "cost_details": {...},
    "completion_tokens_details": {...}
  }
}

Expected Behavior

In other modes, a cost_sats variable is returned by the backend alongside the USD cost.

Environment

  • Mode: x-cashu
  • Backend: routstr-core

Steps to Reproduce

  1. Enable x-cashu payment mode
  2. Make a request that returns usage information
  3. Observe that cost_sats is missing from the response

Reported via Nostr mention

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions