strings command away from leaking. So don’t ship it. Keep your SDK license on your backend, use it to mint short-lived JWTs, and hand those to clients instead. A JWT drops in exactly where a license key would, and you can swap it for a fresh one before it expires without recreating the processor or reloading the model.
JWT-form license keys and
update_bearer_token() were introduced in SDK 0.19.0, which ships in the Python aic-sdk binding from version 2.3.0 onward.Decode API key from SDK license
Self-service SDK Keys can be generated on the developer platform. This key stays on your backend, where clients never see it.The credential the platform gives you is a signed token of the form
<payload>.<signature>, where the payload is base64-encoded JSON. Decode that payload once at startup to read the api_key field inside it:raw is the license key the SDK accepts directly, exactly as the Quickstart passes it to aic.Processor(...); don’t try to decode it before handing it to the SDK. The inner api_key is what the token endpoint expects. In this tutorial the client never touches either one; it only ever sees the JWT you mint below, so reach for api_key here and leave raw on the backend.These keys are configured to authorize with our backend and collect usage telemetry.
Mint a token on your backend
Exchange your API key for a short-lived JWT by calling the token endpoint. Run this server-side so the credential never reaches the client, then return the token to your app over your own API.
Initialize the SDK with the token
Pass the JWT in place of the license key.
Creating the processor with a minted JWT is what makes the in-place refresh in the next step possible.
update_bearer_token() only swaps a token when both the originally configured key and the new one are JWTs. If you initialize with a plain license key instead, the swap leaves the existing token in place and raises TokenUnsupportedError.Refresh before the token expires
Tokens currently last about an hour, but it could change in the future. Each token tells you when it expires: the
exp claim inside the JWT, mirrored by the expires_at field the token endpoint returns. Derive your refresh time from it and swap the new token in a little before it passes with update_bearer_token() on the processor context. There is no need to recreate the processor or reload the model, and the call is safe to make while audio is processing.If a token expires before you swap in a fresh one, processing raises
LicenseExpiredError. Mint a new token and retry; the proactive refresh above keeps you clear of this. The only case where enhancement actually stops is a revoked or otherwise unauthorized key, which surfaces as EnhancementNotAllowedError. Even then the SDK fails soft: the audio passes through unprocessed and the algorithmic delay is preserved, so the stream is never interrupted. Bypassed audio is tracked by the usage.disallowed and processor.bypass metrics (learn more on the Observability page).Find out more
SDK Quickstart
Real-time speech enhancement with the SDK in your preferred language.
Developer Platform
Generate SDK license keys and explore the SDK playground.
Telemetry
What the SDK reports back and how authorization works.
Python SDK Examples
More examples, including real-time processing and analysis.