@ai-sdk/openai 3.0.0-beta.56 → 3.0.0-beta.57

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.
@@ -1652,7 +1652,16 @@ var openaiImageResponseSchema = (0, import_provider_utils12.lazySchema)(
1652
1652
  b64_json: import_v48.z.string(),
1653
1653
  revised_prompt: import_v48.z.string().nullish()
1654
1654
  })
1655
- )
1655
+ ),
1656
+ usage: import_v48.z.object({
1657
+ input_tokens: import_v48.z.number().nullish(),
1658
+ output_tokens: import_v48.z.number().nullish(),
1659
+ total_tokens: import_v48.z.number().nullish(),
1660
+ input_tokens_details: import_v48.z.object({
1661
+ image_tokens: import_v48.z.number().nullish(),
1662
+ text_tokens: import_v48.z.number().nullish()
1663
+ }).nullish()
1664
+ }).nullish()
1656
1665
  })
1657
1666
  )
1658
1667
  );
@@ -1693,7 +1702,7 @@ var OpenAIImageModel = class {
1693
1702
  headers,
1694
1703
  abortSignal
1695
1704
  }) {
1696
- var _a, _b, _c, _d;
1705
+ var _a, _b, _c, _d, _e, _f, _g;
1697
1706
  const warnings = [];
1698
1707
  if (aspectRatio != null) {
1699
1708
  warnings.push({
@@ -1730,6 +1739,11 @@ var OpenAIImageModel = class {
1730
1739
  return {
1731
1740
  images: response.data.map((item) => item.b64_json),
1732
1741
  warnings,
1742
+ usage: response.usage != null ? {
1743
+ inputTokens: (_e = response.usage.input_tokens) != null ? _e : void 0,
1744
+ outputTokens: (_f = response.usage.output_tokens) != null ? _f : void 0,
1745
+ totalTokens: (_g = response.usage.total_tokens) != null ? _g : void 0
1746
+ } : void 0,
1733
1747
  response: {
1734
1748
  timestamp: currentDate,
1735
1749
  modelId: this.modelId,