# Installation & Quickstart > Add the QwryAI iOS SDK to your app and get your first answer from your agent This page takes you from an empty Xcode project to a streamed answer from your agent. You turn on the **iOS SDK** channel in the dashboard, add the Swift package, create a `QwryClient` and send a message. > [!TIP] > > **Want the whole chat without building a UI?** Load your agent's chat page in a `WKWebView`. It shows the same chat your website visitors get. See [Website iframe](/docs/developer-guides/website-integration/iframe). Use the SDK when you want a native chat screen of your own. ## Prerequisites | Requirement | Minimum | | - | - | | iOS | 17.0 | | macOS | 14.0 | | Swift | 6.0 | | Xcode | 16 | | SwiftUI | Not required. The SDK works with UIKit, AppKit or any UI code. | ## Installation The SDK ships as a Swift package, `QwrySDK`, with no dependencies. > [tab] Xcode > > **1. Open Add Package Dependencies** > > In Xcode, choose **File** → **Add Package Dependencies…** > > **2. Paste the repository URL** > > ``` > https://github.com/qwryai/qwryai-ios-sdk.git > ``` > > **3. Pick the version and target** > > Choose **Up to Next Major Version** from `0.1.0`, then add the **QwrySDK** library to your app target. > [tab] Package.swift > > ```swift > // Package.swift > dependencies: [ > .package(url: "https://github.com/qwryai/qwryai-ios-sdk.git", from: "0.1.0") > ], > targets: [ > .target( > name: "YourApp", > dependencies: [ > .product(name: "QwrySDK", package: "qwryai-ios-sdk") > ] > ) > ] > ``` Then import it: ```swift import QwrySDK ``` > [!NOTE] > > No `Info.plist` changes are needed. The SDK calls `https://www.qwryai.com/api/sdk` over HTTPS, which iOS allows by default. ## Quick Start **1. Open the iOS SDK channel** In the dashboard, open your agent and go to **Channels**. On the **iOS SDK** card, select **Manage**. You can also switch to it from the channel menu at the top of the **Playground**. ![The Channels page with the iOS SDK card, described as Integrate your agent into iOS apps using the QwryAI SDK, and the pointer on its Manage button.](annotated/01-channels-ios-sdk.webp "Channels › iOS SDK") **2. Turn on Visibility** Select the **Overview** tab and switch **Visibility** on. Visibility saves as soon as you change it, and from then on the agent accepts requests from the SDK. **Overview** also holds the model and instructions this channel uses; leave **Sync with global instructions** on to answer exactly as your other channels do. ![The Visibility card on the Overview tab of the iOS SDK channel, with the note When disabled, this channel won't be visible and no messages will be routed to your agent, and the pointer on its switch.](annotated/02-visibility.webp "Visibility lets the SDK reach your agent.") > [!WARNING] > > While **Visibility** is off, every SDK request fails with `404` `AGENT_NOT_FOUND`, even when the agent ID is right. **3. Copy your agent ID** Open the **Setup** tab. Under **Agent ID**, select **Copy**. The same tab links to the SDK source and the iOS example app, and repeats the install and quick start code with your agent ID already filled in. ![The Setup, Overview and Actions tabs of the iOS SDK channel, with the pointer on the Setup tab.](annotated/03-setup-tab.webp "Setup holds your agent ID and install code.") **4. Create a client** ```swift import QwrySDK let client = QwryClient(agentId: "YOUR_AGENT_ID") ``` Create the client once and keep it: in a view model, an app-level dependency or a `@State` property. `QwryClient` is an actor, so you can share one client across your app. A new client starts anonymous, tied to a device ID that stays the same across launches. For the other initializer options, see the `QwryClient` reference. **5. Send your first message** ```swift let response = try await client.send("Hello! What can you help me with?") { handlers in handlers.onTextDelta = { piece in // Runs for each piece of text as it arrives print(piece, terminator: "") } } print(response.message.text) print("Conversation: \(response.conversationId)") print("Credits used: \(response.credits)") ``` See [ChatResponse](/docs/ios-sdk/chat-response) for every field on the response. **6. Continue the conversation** The client remembers the conversation the last answer belonged to, so the next `send` carries on where you left off: ```swift let followUp = try await client.send("Tell me more") ``` Call `await client.newConversation()` when you want the next message to start a fresh conversation. For a chat screen, use [`ConversationState`](/docs/ios-sdk/swiftui), which also keeps the message list for you. > [!TIP] > > There's no `close()` or cleanup call. Keep one client for as long as your app talks to the agent. ## Next steps > [card] Streaming | /docs/ios-sdk/streaming | Show the answer as it's written, retry it, or stop it. > [card] SwiftUI | /docs/ios-sdk/swiftui | Ready-made observable state for chat screens. > [card] Client-Side Tools | /docs/ios-sdk/client-side-tools | Let your agent run Swift code on the device. > [card] Error Handling | /docs/ios-sdk/error-handling | What can fail, and what to do about it.