Skip to main content
Beta Release. The Chatbase iOS SDK is currently in beta (v0.1.0-beta.1). APIs may change in future releases.
Conversation methods apply exclusively to conversations created through the mobile SDKs (iOS and Android). Conversations generated through the widget, the API, or external integrations cannot be accessed using the SDK. A user identified on both platforms sees their iOS and Android SDK conversations together.

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/await and 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 ConversationState and ConversationListState
  • 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 subsystem com.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 an APIError.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