iOS SDK overview

Add an Askocto agent to a native iOS app with the Swift SDK: chat, streaming, client tools and user identity, built on async/await.

Working draft. These docs are illustrative: names, endpoints and examples describe the intended behaviour and can change before launch.

The iOS SDK lets a native app talk to one of your agents. Use it when you want the conversation to live inside your own screens instead of a web view. The SDK is a Swift package named Askocto. It uses async/await for single requests and AsyncThrowingStream for streaming, and it mirrors the Android SDK concept for concept, with the same type and method names.

What the SDK covers

  • Chat. Send a message with OctoClient and get a ChatResponse with the answer, the sources used and the credit usage.
  • Streaming. Receive the answer piece by piece as an AsyncThrowingStream of StreamEvent values.
  • Conversations. List past conversations, load their messages and continue one by passing its id.
  • Client tools. Register a ClientTool so the agent can ask your app to do something on the device, such as opening an order screen.
  • User identity. Pass a UserIdentity so conversations belong to a signed-in customer.
  • Errors. Every failure arrives as a typed OctoError.

What you need

  • An app that targets iOS 16 or later.
  • The id of a published agent, for example agt_123. Find it under Settings > General inside the agent.
  • Network access for the app.

The SDK never needs a workspace API key. Do not put one in an app, because keys act on the whole workspace.

Pages in this section

Something unclear or missing? Tell us and we will fix the page.