Bring Your Own AI Service
Using your own AI service does not create a separate device workflow. Device connection, AI request events, the SCO or Opus audio path selected by the device, session coordination, and cleanup continue to follow the corresponding AIBuds feature documentation.
The integration difference is authentication and AI processing: the host app authenticates its own service, reports that result to the device, and uses its own AI implementation instead of an SDK-provided AI service.
Self-owned AI authorization handoff
Authenticate the app's AI service, report the result to the device, and then continue the standard device-driven AI flow.
What Changes
The host app owns authentication for its AI service and the AI-specific request processing. After each authentication attempt, it reports the current result through reportSelfAiServiceAuthResult.
What Stays the Same
The AIBuds device workflow does not need to be replaced. Continue to use the documented device events, requested audio channel, feature lifecycle, stop handling, and cleanup for AI Chat, AI Audio Recording, Streaming ASR, Simultaneous Interpretation, or the feature being implemented.
For example, when the device requests Opus input, it can send the voice stream only after the self-owned AI service is authorized and the successful result has been reported. When the device requests SCO, the app continues to prepare the documented SCO recording path. Using your own AI service does not change which side selects the audio channel.
Implement with AI Assistance
Connect your own AI service with AI
The official skill guides the AIBuds device workflow and integration boundary. Your AI client, credentials, and service logic remain app-owned.
Read and follow https://docs-aibuds.github.io/skills/integrate-aibuds-sdk as the AIBuds integration guide. In this iOS project, connect the existing app-owned AI service to the documented AIBuds device workflow. Inspect and preserve the app's AI client, credentials boundary, architecture, and product behavior. Do not replace it with an AIBuds AI provider or send credentials to the SDK. Report only the authentication result through the documented public API. If required details of the app-owned service are missing, ask focused questions before implementing. Verify the end-to-end device, audio, event, failure, and cleanup flow.Report the Authentication Result
- Swift
- Objective-C
func selfAIAuthenticationDidFinish(isAuthenticated: Bool) {
guard let serviceAuthAPI = device as? DeviceServiceAuthAPI else { return }
// Report only the result. Authentication is completed by the host app.
serviceAuthAPI.reportSelfAiServiceAuthResult(isAuthenticated) {
reportSucceeded,
error in
guard reportSucceeded else {
print(error?.localizedDescription ?? "Failed to report authorization")
return
}
// A true result allows the device to continue eligible AI flows.
// A false result keeps the device informed that the service is unavailable.
}
}- (void)selfAIAuthenticationDidFinish:(BOOL)isAuthenticated {
if (![self.device conformsToProtocol:@protocol(AIBudsDeviceServiceAuthAPI)]) {
return;
}
id<AIBudsDeviceServiceAuthAPI> serviceAuthAPI = (id<AIBudsDeviceServiceAuthAPI>)self.device;
// Report only the result. Authentication is completed by the host app.
[serviceAuthAPI reportSelfAiServiceAuthResult:isAuthenticated
completion:^(BOOL reportSucceeded, NSError *error) {
if (!reportSucceeded) {
NSLog(@"%@", error.localizedDescription);
return;
}
// A true result allows the device to continue eligible
// AI flows. A false result keeps the device informed
// that the service is unavailable.
}];
}See reportSelfAiServiceAuthResult and Report Self-AI Authorization for the complete API contract.
:::note Completion semantics The completion handler reports whether the Boolean result was delivered to the device. It does not indicate whether the host app successfully authenticated the AI service. Do not send tokens, API keys, or other credentials through this API. :::
Integration Checklist
- Authenticate the self-owned AI service in the host app.
- Report
trueonly when that service is ready for AI requests. - Report
falseafter authentication failure or when the service is unavailable. - Continue the documented device event, SCO or Opus, session, and cleanup flow for the selected AI feature.
- Keep credentials inside the app's own secure service integration; report only the Boolean result to the device.