Beta Release. The Chatbase iOS SDK is currently in beta (v0.1.0-beta.1). APIs may change in future releases.
What is the Chatbase iOS SDK?
The Chatbase iOS SDK is a Swift library that lets you add Chatbase AI agents to your iOS or macOS app. It gives you:- Real-time streaming with
async/awaitand per-chunk callbacks - Client-side tools that let the AI agent run functions on the device
- User identity with JWT sign-in and an automatic device ID
- Conversation management with paginated history
- Ready-made SwiftUI state through
ConversationStateandConversationListState - Typed errors for everything that can go wrong
Everything in the SDK lives in one module,
ChatbaseSDK. A single import ChatbaseSDK gives you every type in these docs.Requirements
iOS 17.0 or macOS 14.0, Swift 6.0, and Xcode 16. See Installation & Quickstart for the full prerequisites and setup.Logging
The SDK writes to Apple’s logging system under the subsystemcom.chatbase.sdk, in three categories:
View them in Console.app, or run
log stream --predicate 'subsystem == "com.chatbase.sdk"'. Message text is never logged.
Rate Limits
Chatbase allows 1,000 requests every 10 seconds per device. Going over throws anAPIError.httpError with status 429. See Error Handling.
Next Steps
Installation & Quickstart
Add the SDK to your project and send your first message
Streaming
Stream replies with async/await and callbacks
SwiftUI
Ready-made state for chat screens
Client-Side Tools
Let the AI agent run functions on the device
Conversations
Conversations, history, and pagination
User Identity
Sign users in with JWT tokens
Error Handling
Error types and how to handle them