Skip to content

Clarify semantics of assistant.usage.cost in TypeScript SDK (estimated vs billable) #534

@schplitt

Description

@schplitt

Hi team 👋

I’m using the TypeScript SDK and collecting usage metrics from assistant.usage events (inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens, cost).

I’m seeing cost values that appear inconsistent with expected billing and with the token profile of the run.
Before relying on this field, I’d like clarification in docs on what cost actually represents.

  • What is the unit of assistant.usage.cost?
    • USD (e.g., dollars),
    • cents,
    • micro-dollars,
    • normalized/internal units,
    • or something else?
  • Is assistant.usage.cost:
    • estimated cost,
    • normalized/internal units,
    • or actual billable cost?
  • Is it guaranteed to match provider/GitHub billing, or only directional?
  • Is it per-event incremental or cumulative per turn/session?
  • How should consumers aggregate multiple usage events correctly?
  • Are cache tokens already reflected in cost, and if so, how?
  • Are there known cases where cost is omitted or less reliable?

Many of us are building observability dashboards and guardrails around SDK usage.
Without clear semantics (including units), users may misinterpret cost as invoice-accurate billing.

If there’s already guidance, a link would be super helpful. Otherwise, adding a short section to usage-event docs would prevent confusion.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions