Alpha Release. The Chatbase Android SDK is currently in alpha (v0.0.1-alpha03). APIs may change in future releases.
What is the Chatbase Android SDK?
The Chatbase Android SDK is a Kotlin-first library that lets you integrate Chatbase agents into your Android app. It provides:- Real-time streaming with two levels of abstraction
- Client-side tools that let the agent invoke local functions on the device
- User identity with JWT-based authentication and automatic device ID tracking
- Conversation management with cursor-based pagination
- Structured error handling with typed exceptions
Installation
- Kotlin DSL
- Groovy
The SDK declares the
INTERNET permission in its own manifest. It is merged automatically — you do not need to add it to your app’s manifest.Quick Start
1
Get your Agent ID
- Go to the Chatbase Dashboard
- Select your agent
- Go to Settings → General
- Copy the Agent ID
2
Enable the Android SDK channel
In the dashboard, go to Deploy → Android SDK and enable the channel for your agent.
3
Create a client
context can be any Android Context (Activity, Application, etc.). It is only used during creation to generate the device ID.4
Send your first message
5
Clean up
Chatbase
object Chatbase — Package: com.chatbase.sdk
The singleton factory for creating SDK clients.
create
Context
required
Any Android
Context. Used only during creation to generate the device ID.String
required
The Chatbase agent ID to connect to.
create (with configuration)
ChatbaseConfig
data class ChatbaseConfig — Package: com.chatbase.sdk
Rate Limits
The Chatbase API enforces a rate limit of 1,000 requests per 10 seconds per device, applied server-side. When the limit is exceeded, the SDK throws anApiException with isRateLimited == true. See Error Handling for how to handle this.
Next Steps
Streaming
Real-time streaming with callbacks and Kotlin Flow
Client-Side Tools
Register local tool handlers the agent can invoke
Conversations
Manage conversations, history, and pagination
Error Handling
Exception hierarchy and error handling patterns
