Android SDK overview

Add an Askocto agent to a native Android app with the Kotlin SDK: chat, streaming, client tools and user identity.

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

The Android 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 written in Kotlin, uses suspend functions for single requests and Flow for streaming, and mirrors the iOS SDK concept for concept.

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 token by token as a Flow 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 Android project with Kotlin coroutines and minSdk 24 or higher.
  • The id of a published agent, for example agt_123. Find it under Settings > General inside the agent.
  • Network access. The app needs the INTERNET permission.

The SDK is published as co.askocto:sdk. It never needs a workspace API key, and you should 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.