<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/GeneratedContent/id",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation Models"
    ],
    "preciseIdentifier" : "s:16FoundationModels16GeneratedContentV2idAA12GenerationIDVSgvp"
  },
  "title" : "id"
}
-->

# id

A unique id that is stable for the duration of a generated response.

```
var id: GenerationID?
```

## Discussion

A [`LanguageModelSession`](/documentation/FoundationModels/LanguageModelSession) produces instances of [`GeneratedContent`](/documentation/FoundationModels/GeneratedContent) that have a
non-nil `id`. When you stream a response, the `id` is the same for all partial generations in the
response stream.

Instances of [`GeneratedContent`](/documentation/FoundationModels/GeneratedContent) that you produce manually with initializers have a nil `id`
because the framework didn’t create them as part of a generation.

---

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)