Policy.canvas(anthropic:)Wire any frontier model in one line
Anthropic, OpenAI, on-device — same API. The policy owns the round-trip; you own the surface.
The native iOS canvas where AI assistants come alive — drop into your chat, no server, no iframe.
$ swift package add ainativeuiPolicy.canvas(anthropic:)Anthropic, OpenAI, on-device — same API. The policy owns the round-trip; you own the surface.
AICanvasView(session:)Renders alongside whatever chat surface you already ship. The canvas is a view, not a window.
suggestion_cluster recipeManifest a cluster of choices; the user's first tap is local — no model round-trip, no spinner.
| Vs. | Native iOS | Same chat | No backend | Frontier model | Whole-app build |
|---|---|---|---|---|---|
| AINativeUI | |||||
| OpenAI Apps SDK | |||||
| Anthropic Artifacts | |||||
| MCP Apps (SEP-1865) | |||||
| CopilotKit / AG-UI | |||||
| Apple Intelligence |
We're not a web framework and not a tool for building a whole app from a prompt. The columns where we say no are honest about the shape of the wedge.
Three price points, three vendors, one substrate. The wedge is real.
import AINativeUIAgent
import AINativeUIAnthropic
import AINativeUIWidgets
import AINativeUIRecipes
@State private var session = Session(
policy: .canvas(anthropic: ProcessInfo.processInfo.environment["ANTHROPIC_API_KEY"]!)
)
var body: some View {
VStack {
AICanvasView(session: session)
.aiBuiltinWidgets()
.aiBuiltinRecipes()
ChatInputView(onSend: { prompt in Task { try? await session.send(prompt) } })
}
}The canvas is a SwiftUI view, the policy owns the model round-trip, and your existing input field stays exactly where it was.
Read the full guide