Skip to main content

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.

Animated workflow

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.

App ↔ device

Connect the Device

Establish the normal AIBuds device connection and wait until the required feature APIs are ready.

Host app ↔ own AI

Authenticate Your AI Service

The host app completes authentication using its own service integration.

App → device

Report the Result

Send true when the service is ready, or false when authentication fails or the service is unavailable.

Device + app

Continue the Standard Flow

The device can continue eligible AI requests and the documented SCO or Opus audio flow after a successful report.

standard AIBuds flow
Host app ↔ own AI

Process with Your AI

Handle the AI request with the app's own service while preserving the normal device-facing lifecycle.

The report synchronizes authorization state with the device. It does not authenticate the AI service or carry credentials.

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

Build with AI

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.
View integration skill

Report the Authentication Result

Swift
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.
    }
}

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 true only when that service is ready for AI requests.
  • Report false after 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.