# QwryClient > The initializer, properties and methods of QwryClient, the main entry point of the QwryAI iOS SDK `public actor QwryClient` `QwryClient` talks to one QwryAI agent. Create it once and keep it. Because it's an actor, you can call it from any task, and its methods and mutable properties are reached with `await`. ## init ```swift public init( agentId: String, baseURL: URL = QwryClient.defaultBaseURL, configuration: URLSessionConfiguration = .default, maxToolLoopSteps: Int = 10 ) ``` | Parameter | Type | Default | Description | | - | - | - | - | | `agentId` | `String` | Required | Your agent's ID, from the **Setup** tab of the **iOS SDK** channel. | | `baseURL` | `URL` | `https://www.qwryai.com/api/sdk` | The SDK API to call. Leave it at its default. | | `configuration` | `URLSessionConfiguration` | `.default` | The session configuration used for every request. Set timeouts and caching here. | | `maxToolLoopSteps` | `Int` | `10` | How many rounds of tool calls one `send` or `retry` may make before it throws `QwryError.toolLoopLimitExceeded`. See [Client-Side Tools](/docs/ios-sdk/client-side-tools). | ```swift // Custom timeouts let config = URLSessionConfiguration.default config.timeoutIntervalForRequest = 30 config.timeoutIntervalForResource = 300 let client = QwryClient( agentId: "YOUR_AGENT_ID", configuration: config, maxToolLoopSteps: 20 ) ``` > [!TIP] > > `timeoutIntervalForRequest` measures the gap between pieces of data, not the length of the whole response. A long streamed answer isn't cut off by a 30-second timeout as long as text keeps arriving. ## Properties | Property | Type | Description | | - | - | - | | `agentId` | `String` | The agent this client talks to. | | `deviceId` | `String` | The device ID. Always available, without `await`. | | `authState` | `AuthState` | `.anonymous`, or `.identified(userId:)` after a successful `identify`. | | `currentConversationId` | `String?` | The conversation `send` continues. `nil` until the first answer, and after `newConversation()`, `identify` or `logout`. | | `currentUserId` | `String?` | The signed-in user's ID, or `nil` while anonymous. | The type also has two static values: `QwryClient.version` (`"0.1.0"`) and `QwryClient.defaultBaseURL`. ## Methods | Method | Description | | - | - | | `send(_:conversationId:configure:)` | Send a message, stream the answer and run tools. See [Streaming](/docs/ios-sdk/streaming). | | `retry(conversationId:messageId:configure:)` | Ask the agent to answer again. See [Streaming](/docs/ios-sdk/streaming). | | `sendNonStreaming(_:conversationId:)` | Get the whole answer at once, with no handlers. Tools still run. See [Streaming](/docs/ios-sdk/streaming). | | `tool(_:handler:)` | Register a tool the agent can run on the device. See [Client-Side Tools](/docs/ios-sdk/client-side-tools). | | `removeTool(_:)` | Stop handling a tool. See [Client-Side Tools](/docs/ios-sdk/client-side-tools). | | `identify(token:)` | Sign a user in with a JWT; returns their user ID. See [User Identity](/docs/ios-sdk/user-identity). | | `logout()` | Go back to anonymous. See [User Identity](/docs/ios-sdk/user-identity). | | `newConversation()` | Clear `currentConversationId`. See [Conversations & History](/docs/ios-sdk/conversations). | | `listConversations(cursor:limit:)` | List past conversations. See [Conversations & History](/docs/ios-sdk/conversations). | | `listMessages(conversationId:cursor:limit:)` | Load a page of a conversation's messages. See [Conversations & History](/docs/ios-sdk/conversations). |