iOS SDK
iOS SDK Overview
A Swift package that puts your QwryAI agent inside your own iOS or macOS app
The QwryAI iOS SDK is the Swift library behind the iOS SDK channel. It sends messages to your agent, streams the answer back, runs the client-side actions you register on the device and keeps each user's conversation history. It has no UI of its own: you draw the chat, and the SDK does the talking.
What the iOS SDK gives you
The SDK covers everything between your chat screen and your agent:
- Streaming answers with
async/awaitand a handler for each piece of text as it arrives - Client-side actions that let your agent run Swift code on the device, then carry on answering
- User identity through a signed JWT, with an automatic device ID for anonymous users
- Conversation history with cursor-based pages
- SwiftUI-ready state in
ConversationStateandConversationListState - One error type,
QwryError, for everything that can go wrong
Requirements
| Requirement | Minimum |
|---|---|
| iOS | 17.0 |
| macOS | 14.0 |
| Swift | 6.0 (Xcode 16 or later) |
See Installation & Quickstart for the full setup.
Rate limits
Each device can make 1,000 requests every 10 seconds to one agent. Going over throws QwryError.api with status 429 and the code RATE_LIMIT_TOO_MANY_REQUESTS; error.isRateLimited is true. See Error Handling.
Next steps
Installation & Quickstart
Add the package to your app and send your first message.
Streaming
Show the answer as it's written, retry it, or stop it.
SwiftUI
Ready-made observable state for chat and conversation-list screens.
Client-Side Tools
Let your agent run Swift code on the device.
Conversations & History
List conversations and page through their messages.
User Identity
Sign users in with a JWT so their history follows them.
Error Handling
QwryError, its codes, and how to handle them.