Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/claude_code_sdk/_internal/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ def _parse_message(self, data: dict[str, Any]) -> Message | None:
# Map total_cost to total_cost_usd for consistency
return ResultMessage(
subtype=data["subtype"],
cost_usd=data["cost_usd"],
# cost_usd=data["cost_usd"],
duration_ms=data["duration_ms"],
duration_api_ms=data["duration_api_ms"],
is_error=data["is_error"],
num_turns=data["num_turns"],
session_id=data["session_id"],
total_cost_usd=data["total_cost"],
# total_cost_usd=data["total_cost"],
usage=data.get("usage"),
result=data.get("result"),
)
Expand Down
4 changes: 2 additions & 2 deletions src/claude_code_sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ class ResultMessage:
"""Result message with cost and usage information."""

subtype: str
cost_usd: float
duration_ms: int
duration_api_ms: int
is_error: bool
num_turns: int
session_id: str
total_cost_usd: float
cost_usd: float | None = None
total_cost_usd: float | None = None
usage: dict[str, Any] | None = None
result: str | None = None

Expand Down