Skip to main content
Chappie is a Swift SDK that lets you embed a ChatGPT-powered assistant directly into your iOS or macOS app. It handles the full lifecycle — signing users in with their ChatGPT account, managing conversation context, streaming responses in real time, and executing host-defined tools — all with a clean, Swift-native API.

Installation

Add Chappie to your Xcode project via Swift Package Manager

Quick Start

Go from zero to a streaming assistant in under 10 minutes

Authentication

Sign users in with their ChatGPT account using one SwiftUI view

Harnesses

Declare your app’s context, tools, and capabilities to the model

How Chappie works

Chappie connects your app to the ChatGPT/Codex backend using your user’s existing ChatGPT account — no OpenAI Platform API keys required. Users authenticate once via a device-code flow, and Chappie stores their credentials securely in Keychain. From there, you create a ChappieClient to send messages, stream responses, and call host-defined tools.
1

Add the package

Add ChappieSDK via Swift Package Manager from https://github.com/b-nnett/chappie-sdk.
2

Sign the user in

Drop ChappieSignIn into your SwiftUI view. It shows a guided onboarding sheet and handles the full device-code OAuth flow with ChatGPT.
3

Define a harness

Create a ChappieHarness that describes your app’s surface — its name, capabilities, and any tools the model can call.
4

Send messages and stream responses

Use client.send(_:) for one-shot replies or client.stream(_:) for real-time streaming. Chappie maintains the conversation transcript automatically.

Explore the SDK

Streaming

WebSocket streaming with automatic SSE fallback

Host Tools

Let the model call Swift functions in your app

Context Management

Snapshot, compact, and resume conversations

Runtime Store

Persist transcripts across app launches

Models & Usage

Select models and monitor usage limits

Configuration

Tune backoff, transport, and Keychain settings