Bring Your Own API Key
Connect Mosaic to Anthropic, OpenAI, or another supported provider using your own API key.
If you already use Anthropic or OpenAI directly — or you don't have Azure AI Foundry capacity yet — Mosaic accepts an API key from supported providers. Inference is billed by the provider, against your account.
Supported providers
If you'd rather keep everything in Azure, see Azure AI Foundry — that's the recommended path for Microsoft-native customers.
Prerequisites
An active account with the provider above and an API key with permission to invoke models
A Tenant Admin account in Mosaic
A billing setup at the provider — Mosaic does not handle inference billing
Steps
Create the API key at your provider
Sign in at the provider and create an API key scoped narrowly:
Limit it to inference calls only (no admin / billing scopes)
Set a usage cap — both as a hard limit and a soft alerting threshold
Tag or name the key
mosaic-prodso you can identify it later
Copy the key immediately — most providers don't let you view it again after creation.
Connect Mosaic to your provider
In Mosaic:
Admin → AI Configuration
Add provider → choose Anthropic or OpenAI
Paste the API Key
Pick the default model (e.g.,
claude-3-5-sonnet-20241022,gpt-4o). Specific recommendations:Anthropic: Claude Sonnet for the orchestrator agent; Claude Haiku is fine for cheaper, lower-latency flows
OpenAI: GPT-4o for the orchestrator; GPT-4o-mini for cheaper flows
Click Test connection — Mosaic sends a tiny test prompt and verifies the response
Click Save
Verify
Open a Mosaic chat and ask any question. Check Admin → AI Sessions — the model name shown should match the one you selected.
Operational tips
Set a usage cap
Both Anthropic and OpenAI let you set monthly spend caps. Set a hard cap that's higher than your expected usage but well below the worst case. If a runaway agent loop ever happens, the cap stops the bleed.
Rotate keys periodically
Treat the LLM API key like any other production credential. Rotate quarterly:
Create a new key at the provider
Update Mosaic with the new key
Test
Revoke the old key at the provider
Mosaic stores the key encrypted; rotating doesn't invalidate any session history.
Switching providers
You can change provider at any time in Admin → AI Configuration. New chat sessions use the new provider; in-flight sessions complete on the previous one. No data migration is needed; chat history lives in Mosaic regardless of which inference backend ran it.
When to switch to Azure AI Foundry
If any of these become true, plan a move to Foundry:
Compliance requires data residency in your Azure tenant
Your AI usage exceeds direct-API rate limits and you need provisioned throughput
You want to consolidate AI billing under your existing Azure spend commit
The migration is straightforward — see Azure AI Foundry. No Mosaic-side data needs to move.
What's next
Last updated