ippo_agents
Flutter/Dart SDK for IppoPay LoanPilot Agents — start a live voice AI call with one of your agents using only an ippo API key. The real-time transport (LiveKit) is bundled and hidden: your app only ever sees this SDK.
It is the Dart sibling of the TypeScript SDK @ippopone/agents-sdk — same
agent.ippo.one API, same agents, same API key, just for Flutter.
The flow: API key + agent id → any app
Build any kind of voice/chat app with two things:
- an ippo API key (from your LoanPilot Agents account), and
- an agent id (an agent you configured on
agent.ippo.one— its prompt, voice and client tools).
Point the SDK at that agent and your users can talk (voice) or type (chat). The agent drives your app's screens through its client tools; your UI is entirely yours. The domain is whatever your agent is — support bot, ordering, booking, a loan assistant, anything.
Install
flutter pub add ippo_agents
Microphone permission
A voice call needs the mic. Add the platform entries once:
- iOS —
ios/Runner/Info.plist:<key>NSMicrophoneUsageDescription</key> <string>Talk to your loan assistant.</string> - Android —
android/app/src/main/AndroidManifest.xml:
and set<uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.INTERNET" />minSdkVersion 23inandroid/app/build.gradle.
Request the runtime permission before starting a call (e.g. with
permission_handler).
Quick start
import 'package:ippo_agents/ippo_agents.dart';
final ippo = IppoAgents(apiKey: 'sk_live_...'); // dev: ippo agents key
final call = await ippo.startVoiceCall(agentId: 'agt_123');
// Live captions and the user's words:
call.transcripts.listen((t) {
print('${t.role.name}: ${t.text}');
});
// Show a mic/▮ talking indicator:
call.botSpeaking.listen((speaking) => setState(() => _talking = speaking));
// The agent drives your UI through client tools — answer them:
call.onToolCall('show_step', (args) async {
showCard(args['step'] as String);
return 'Card shown';
});
// ... later
await call.setMicEnabled(false); // mute
await call.end(); // hang up
That's the whole thing — no LiveKit, no WebRTC, no token plumbing in your code.
Text chat (same agent, same key)
final chat = ippo.startChat(agentId: 'agt_123');
chat.deltas.listen((chunk) => setState(() => _reply += chunk)); // live typing
chat.messages.listen((m) => print('assistant: ${m.text}')); // completed turn
final reply = await chat.send('What loan can I get?');
// conversation memory is kept automatically via chat.sessionId
Voice and chat share the same agent and the same API key — build a voice app, a chat app, or one app that does both.
Authentication
| Mode | Use | How |
|---|---|---|
| API key | local dev, server-side | IppoAgents(apiKey: '…') |
| Token provider | shipped apps | IppoAgents.tokenProvider(fn) |
A shipped mobile app should not embed a raw API key (it can be extracted
from the binary). In production, mint the call token on your backend (which
holds the key and calls POST /api/agents/{id}/connect) and hand it back:
final ippo = IppoAgents.tokenProvider((agentId, options) async {
final res = await myBackend.connect(agentId); // your server holds the key
return ConnectResult(
callId: res['callId'], livekitUrl: res['livekitUrl'],
token: res['token'], roomName: res['roomName'],
);
});
final call = await ippo.startVoiceCall(agentId: 'agt_123');
API surface
IppoAgents
startVoiceCall({agentId, options, enableMicrophone})→VoiceCallstartChat({agentId, dynamicVariables})→ChatSessionconnect(agentId, {options})→ConnectResult(room + token, no join)listAgents()/getAgent(id)— discover agent ids (API-key mode only)dispose()
ChatSession (text)
send(message)→Future<String>(full reply; chunks also ondeltas)- streams:
deltas(token-by-token),messages(completed turns) sessionId(conversation memory) ·reset()·dispose()
VoiceCall
- streams:
transcripts,botSpeaking,states,rawEvents onToolCall(name, handler)/offToolCall(name)sendUserMessage(text)— send a tap/typed line as the user's wordssetMicEnabled(bool)/isMicEnabledend()·callId·isEnded
Client tools — the agent calls these; you handle them and return a short string the agent speaks from next:
call.onToolCall('check_pan', (args) async {
final report = await myBackend.pullCredit(args['pan'] as String);
return 'PAN verified. Score ${report.score}. Tell them in one sentence.';
});
Manage the platform (REST parity with the npm SDK)
Beyond voice/chat, the client exposes the same resources as @ippopone/agents-sdk:
await ippo.agents.create({'name': 'Support bot', ...});
await ippo.agents.publishVersion(id, label: 'v2');
await ippo.calls.outbound({'agentId': id, 'to': '+91...'}); // phone call
final rates = await ippo.providers.rates();
await ippo.campaigns.start(cid);
await ippo.dnc.add('+91...');
Namespaces: agents (list/get/create/update/delete/publishVersion/listVersions/
getVersion/rollbackToVersion), calls (list/get/outbound/end/transfer),
providers, templates, campaigns (+ leads), dnc, phoneNumbers, eval
(simulate/test-cases/runs), settings.
Customization
final ippo = IppoAgents(
apiKey: 'sk_...',
baseUrl: 'https://agent.ippo.one', // staging/self-host override
timeout: const Duration(seconds: 20),
maxRetries: 3, // idempotent GETs retry on 429/5xx
organizationId: 'org_123', // multi-org keys
defaultHeaders: {'x-trace-id': '...'},
);
License
MIT © IppoPay
Libraries
- ippo_agents
- IppoPay LoanPilot Agents — Flutter/Dart SDK.