Bring Your Own Key
Bring Your Own Key (BYOK) lets your organisation send requests to AI providers with its own API keys instead of the Serenity* Star keys. The provider bills these requests to your own account, so they are not charged to your Serenity* Star balance.
With BYOK you can:
- Use your own provider account, with its own agreement and usage limits.
- Add more than one key for the same provider. Serenity* Star spreads the requests across them (API key pooling).
- Assign a key to specific models of a provider.
You manage your keys in the My Keys tab of the Compliance Center.
Availability
BYOK is a feature of your subscription plan. If your plan does not include it, the My Keys tab shows an upgrade message instead of your keys.
These roles can manage the keys:
- Tenant administrator
- AI connection setting administrator
You assign roles in Users.
Add a Key
- Go to Settings > Compliance Center > My Keys.
- Click New Key.
- Select the provider.
- Complete the fields. The fields depend on the provider: for example, an API key, or an endpoint and a deployment name.
- Optional: in AI Models, select the models that can use this key. If you select no models, the key applies to all the models of the provider.
- Save the key.
For screenshots of each step, and to edit, activate or deactivate a key, see My Keys.
How Serenity* Star Selects a Key
For each request to a model, Serenity* Star looks for a key in this order and uses the first group that has keys:
- Your active keys for the provider that have the model selected in AI Models.
- Your active keys for the provider that have no models selected.
- The Serenity* Star keys.
If a group has more than one key, Serenity* Star selects a key at random from that group. This spreads the requests across your keys.
A key with models selected is used only for those models. For the other models of the same provider, Serenity* Star uses your keys with no models selected. If you have none, it uses the Serenity* Star keys.
What Uses Your Keys
The selection above applies to the requests that Serenity* Star sends to a model on behalf of your organisation, for example:
- Agent executions, including the fallback model of an agent.
- Knowledge: the embeddings that index and search your documents.
- AI Services, such as Image Generation, Transcription, Embedding Generation and Decisions.
- Skills that call a model, such as Web Search and Code Execution.
Some services run on models that Serenity* Star hosts. These services always use the Serenity* Star keys.
When a Key Is Inactive or Fails
Inactive keys. Serenity* Star never uses an inactive key. The selection continues with the next group. If you have no other active key for the model, the request uses the Serenity* Star keys and is charged to your balance.
Keys that fail. When a request in an agent execution fails, Serenity* Star tries again with another key of the same group:
- If the request used your keys, it tries only your other keys. It does not change to the Serenity* Star keys for the same model.
- A key that fails is skipped in the next agent executions for a period of time.
- Some errors do not cause a new attempt, because another key gives the same result. An example is a request that is longer than the context window of the model.
If the agent has a fallback model, Serenity* Star tries the fallback model when the attempts with the main model fail. It selects the key for the fallback model with the same rules. If you have no active key for the fallback model, the Serenity* Star keys are used and the usage is charged to your balance.
If all the attempts fail, the execution fails.
Billing
When a request uses your key:
- Your provider bills the usage to your provider account.
- Serenity* Star records the usage with its own concepts, for example Input token usage with own Key and Output token usage with own Key. These concepts are not deducted from your Serenity* Star balance.
- Serenity* Star calculates an estimated cost from the provider price of the model.
When a request uses the Serenity* Star keys, the usage is charged to your balance as usual.
The usage cards of the cost dashboards show the two parts of the cost:
- Charged to your balance: the cost charged to your Serenity* Star balance.
- Estimated BYOK cost: the estimated cost of the usage with your keys.
The estimated BYOK cost can be different from the amount that your provider bills. See Cost Dashboard.
Bring Your Own Key and Bring Your Own Model
| Bring Your Own Key | Bring Your Own Model | |
|---|---|---|
| What you add | Your API key for a provider that Serenity* Star supports | A new model, served from your own OpenAI-compatible endpoint |
| Models | The models of the Serenity* Star catalogue | The models that you register, available only to your organisation |
| Where | Compliance Center > My Keys | Compliance Center > Bring your own Model |
| Plan feature | Bring Your Own Key | Bring Your Own Model |