@ai-sdk/xai 3.0.50 → 3.0.51

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 3.0.51
4
+
5
+ ### Patch Changes
6
+
7
+ - e1d5111: fix(provider/xai): correct usage token calculation for reasoning models
8
+
3
9
  ## 3.0.50
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -168,8 +168,8 @@ function convertXaiChatUsage(usage) {
168
168
  cacheWrite: void 0
169
169
  },
170
170
  outputTokens: {
171
- total: usage.completion_tokens,
172
- text: usage.completion_tokens - reasoningTokens,
171
+ total: usage.completion_tokens + reasoningTokens,
172
+ text: usage.completion_tokens,
173
173
  reasoning: reasoningTokens
174
174
  },
175
175
  raw: usage
@@ -2516,7 +2516,7 @@ var xaiTools = {
2516
2516
  };
2517
2517
 
2518
2518
  // src/version.ts
2519
- var VERSION = true ? "3.0.50" : "0.0.0-test";
2519
+ var VERSION = true ? "3.0.51" : "0.0.0-test";
2520
2520
 
2521
2521
  // src/xai-provider.ts
2522
2522
  var xaiErrorStructure = {