Tracks the SDK-side migration for content-server #2086 (W5.3).
Context
content-server #2086 changes every agent-facing REST response and usage header to present money as USD-denominated credits instead of karma, using the canonical rate 1 credit = $1.00 = 1,000 karma (credits = karma / 1000, 4dp).
Per the decision on that issue, this is a replace, not additive change: the karma_* fields and X-*-Karma-* headers are removed and replaced with credit equivalents — there is no one-release deprecation window. That makes it a breaking change for this SDK, which is why it needs its own tracked migration that lands after content-server #2086 deploys.
Two things change on the wire:
- Field/header renames —
karma_* → credits_* (e.g. karma_charged → credits_charged, karma_cost → credits_cost, amount_karma → amount_credits, estimated_karma_cost → estimated_credits_cost); currency on the credits endpoint becomes "credits"; headers X-Karma-Used/Balance → X-Credits-Used/Balance and X-Deva-Karma-Cost/Balance → X-Deva-Credits-Cost/Balance.
- Magnitude + type change — every money value shrinks by a factor of 1,000 and goes from an integer karma count to a 4dp credit decimal (e.g. balance
1000 → 1.0000, a 58-karma image cost → 0.0580).
Internal karma logic on the server (charging, buckets, ledger, emission) is unchanged — only the presented unit changes.
SDK touch-points to update
Audit of src/ against the credits-only surface:
Coordination
- Land and release after content-server #2086 is deployed to production (the wire format flips at that point).
- No dual-read/back-compat path is needed on the server side, so pin the minimum server version this SDK release targets.
Out of scope
- Any change to how karma is charged or accounted on the server (unchanged — presentation only).
- Deva-social user-facing karma.
Tracks the SDK-side migration for content-server #2086 (W5.3).
Context
content-server #2086 changes every agent-facing REST response and usage header to present money as USD-denominated credits instead of karma, using the canonical rate 1 credit = $1.00 = 1,000 karma (
credits = karma / 1000, 4dp).Per the decision on that issue, this is a replace, not additive change: the
karma_*fields andX-*-Karma-*headers are removed and replaced with credit equivalents — there is no one-release deprecation window. That makes it a breaking change for this SDK, which is why it needs its own tracked migration that lands after content-server #2086 deploys.Two things change on the wire:
karma_*→credits_*(e.g.karma_charged→credits_charged,karma_cost→credits_cost,amount_karma→amount_credits,estimated_karma_cost→estimated_credits_cost);currencyon the credits endpoint becomes"credits"; headersX-Karma-Used/Balance→X-Credits-Used/BalanceandX-Deva-Karma-Cost/Balance→X-Deva-Credits-Cost/Balance.1000→1.0000, a58-karma image cost →0.0580).Internal karma logic on the server (charging, buckets, ledger, emission) is unchanged — only the presented unit changes.
SDK touch-points to update
Audit of
src/against the credits-only surface:src/types.ts:149— chat usage objectdeva?: { karma_cost; karma_balance }→{ credits_cost; credits_balance }; update any header parsing that readsX-Deva-Karma-Cost/X-Deva-Karma-Balanceto theX-Deva-Credits-*names.src/resources/wallet.ts:5—WalletBalance.karma?: number→ credits (decimal); revisitavailable/pendingif they are karma-denominated.src/resources/models.ts:6-9—prompt_karma/completion_karmaper-token pricing andcurrency— confirm whether these are sourced from a content-server surface in scope of #2086; migrate to credit-denominated pricing if so.src/errors.ts:45— "Out of karma / quota" comment; reword to credits (cosmetic).examples/andREADME.mdfor karma-denominated numbers and1000 karma = $1framing; restate as credits.Coordination
Out of scope