<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/LanguageModelExecutorGenerationChannel/ToolCalls/Action-swift.struct/updateUsage(input:output:metadata:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation Models",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:16FoundationModels38LanguageModelExecutorGenerationChannelV9ToolCallsV6ActionV11updateUsage5input6output8metadataAgC0L0V5InputV_AM6OutputVSDySSAA29ConvertibleToGeneratedContent_pGtFZ"
  },
  "title" : "updateUsage(input:output:metadata:)"
}
-->

# updateUsage(input:output:metadata:)

Creates an action that replaces the entry’s token-usage totals.

```
static func updateUsage(input: LanguageModelExecutorGenerationChannel.Usage.Input, output: LanguageModelExecutorGenerationChannel.Usage.Output, metadata: [String : any ConvertibleToGeneratedContent] = [:]) -> LanguageModelExecutorGenerationChannel.ToolCalls.Action
```

## Parameters

`input`

The token counts for the transcript submitted to the model.

`output`

The token counts for the response the model produces.

`metadata`

Additional metadata to record alongside the token counts.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)