Swift SDK
ElevenAgents SDK: deploy customized, interactive voice agents in your Swift applications.
ElevenAgents SDK: deploy customized, interactive voice agents in your Swift applications.
Check out our complete Swift quickstart project to get started quickly with a full working example.
Add the ElevenLabs Swift SDK to your project using Swift Package Manager:
Ensure you add NSMicrophoneUsageDescription to your Info.plist to explain microphone access to
users. The SDK requires iOS 14.0+ / macOS 11.0+ and Swift 5.9+.
Get started with a simple conversation in just a few lines. Optionally, We recommended passing in your own end user id’s to map conversations to your users.
There are two ways to authenticate and start a conversation:
For public agents, use the agent ID directly:
The SDK provides a modern Conversation class with @Published properties for reactive UI updates:
Client Tools allow you to register custom functions that can be called by your AI agent during conversations. The new SDK provides improved parameter handling and error management.
Handle tool calls from your agent with full parameter support:
Remember to setup your agent with the client-tools in the ElevenLabs UI. See the Client Tools documentation for setup instructions.
Monitor the conversation state to handle different connection phases:
Track when the agent is listening or speaking:
Send text messages and monitor the conversation:
Monitor character-level timing data for synchronized text display:
Here’s a comprehensive SwiftUI example using the new SDK: