# Azure Foundry (Claude) (BYOK)

> How to create an API key for Azure Foundry (Claude) and add it to AnyRouter via Bring Your Own Key.


# Azure Foundry (Claude) — Bring Your Own Key

Use Claude from your own Microsoft Foundry resource. AnyRouter calls your resource directly, so Azure bills you through your Marketplace subscription.

## Get your API key

1. In [Microsoft Foundry](https://ai.azure.com/), open **Discover → Models**, pick a Claude model and **Deploy** it. Keep the default deployment name (the model name).
2. Open the deployment and copy the resource endpoint (`https://<resource>.services.ai.azure.com`) and the API key.
3. Paste a JSON object into AnyRouter: `{ "endpoint_url": "https://<resource>.services.ai.azure.com", "api_key": "<key>" }`.

## Gotchas

If you renamed a deployment, add a `"deployments"` map from the model id to your name, for example `{ "claude-sonnet-4-6": "my-sonnet" }`. Claude on Foundry needs a pay-as-you-go Azure subscription; student, trial and credit-only subscriptions cannot deploy it.

## Add it to AnyRouter

1. Go to **[Dashboard → BYOK](https://anyrouter.dev/dashboard/byok)**.
2. Find **Azure Foundry (Claude)** under **Available** and click **Add key**.
3. Paste your key into the **API key** field.
4. Click **Save**. AnyRouter runs a live validation call against Azure Foundry (Claude) before storing the key — if it fails, the dialog shows the upstream error and the key isn't saved.

## Related

- [BYOK Provider Setup Guide](/features/byok-providers) — the full provider list and the general flow
- [Bring Your Own Key (BYOK)](/features/byok) — routing precedence, load balancing, and costs
- [Free-tier aggregation](/features/free-tier-aggregation) — combine free tiers behind one preset
