CLI, SDKs, and libraries / Libraries and integrations Apple Foundation Models Copy page Use Claude on Apple platforms through the Foundation Models framework with the Claude for Foundation Models Swift package.
Copy page
Claude for Foundation Models is a Swift package that makes Claude available as a server-side language model in Apple's Foundation Models framework. The package conforms Claude to the framework's LanguageModel protocol, so you drive it with the same LanguageModelSession API you use for Apple's on-device model: respond(to:) , streaming, guided generation, and tool calling all work the same way.
Requests go directly from your app to the Claude API; Apple is not in the request path and does not see prompts or responses. Usage is billed to your Anthropic account at standard API pricing. Your app decides when to use Claude and when to use Apple's on-device model: pass whichever model you want to each session.
Beta. This package targets the Foundation Models server-side language model API introduced in the OS 27 betas. APIs may change before general availability.
Claude for Foundation Models is not a general-purpose Messages API client. Its public surface is the Foundation Models provider conformance plus the configuration types that reach it ( ClaudeLanguageModel , ClaudeModel , AuthMode , ClaudeServerTool ). For direct access to the Messages API in another language, see the Client SDKs.
Requirements
iOS 27, macOS 27, visionOS 27, or watchOS 27 (all in beta): the OS releases whose Foundation Models framework supports server-side language models
Xcode 27 (beta)
A Claude API key from the Claude Console for development. See Authentication for production options.
... continue reading