190proof 1.0.120 → 1.0.122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -890,7 +890,8 @@ ${text}` : text;
890
890
  prompt_tokens: promptTokens,
891
891
  completion_tokens: data.usage.output_tokens,
892
892
  total_tokens: promptTokens + data.usage.output_tokens,
893
- cached_tokens: cacheRead
893
+ cached_tokens: cacheRead,
894
+ cache_write_tokens: cacheWrite
894
895
  };
895
896
  }
896
897
  return {
@@ -1500,7 +1501,8 @@ function finalizeOpenRouterMessage(id, raw) {
1500
1501
  prompt_tokens: raw.usage.prompt_tokens,
1501
1502
  completion_tokens: raw.usage.completion_tokens,
1502
1503
  total_tokens: raw.usage.total_tokens,
1503
- cached_tokens: (_e = (_d = raw.usage.prompt_tokens_details) == null ? void 0 : _d.cached_tokens) != null ? _e : 0
1504
+ cached_tokens: (_e = (_d = raw.usage.prompt_tokens_details) == null ? void 0 : _d.cached_tokens) != null ? _e : 0,
1505
+ cost: typeof raw.usage.cost === "number" ? raw.usage.cost : void 0
1504
1506
  } : null
1505
1507
  };
1506
1508
  }
@@ -1780,7 +1782,7 @@ async function callOpenRouterNonStreaming(id, payload, requestTimeoutMs = OPENRO
1780
1782
  "OpenRouter",
1781
1783
  requestTimeoutMs,
1782
1784
  signal,
1783
- (mergedSignal) => axios.post(openRouterEndpoint(), payload, {
1785
+ (mergedSignal) => axios.post(openRouterEndpoint(), { ...payload, usage: { include: true } }, {
1784
1786
  headers: {
1785
1787
  "content-type": "application/json",
1786
1788
  Authorization: `Bearer ${process.env.OPENROUTER_API_KEY}`