For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Provider
Models
Where to get the key

Anthropic

Claude family (Sonnet, Opus, Haiku)

OpenAI

GPT-4, GPT-4o, o1

platform.openai.com → API keys

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

1

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-prod so you can identify it later

Copy the key immediately — most providers don't let you view it again after creation.

2

Connect Mosaic to your provider

In Mosaic:

  1. Admin → AI Configuration

  2. Add provider → choose Anthropic or OpenAI

  3. Paste the API Key

  4. 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

  5. Click Test connection — Mosaic sends a tiny test prompt and verifies the response

  6. Click Save

3

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:

  1. Create a new key at the provider

  2. Update Mosaic with the new key

  3. Test

  4. 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

Mosaic App Configurations →

Last updated