Skip to main content

Documentation Index

Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Braintrust integrates with Anthropic so you can call Claude models from the Braintrust playground, API, and SDKs. Braintrust also traces Anthropic SDK calls from your application, including streaming, prompt caching, server-side tool use, and managed agents.

Add Anthropic as an AI provider

To use Anthropic models in the Braintrust playground, API, and gateway, connect Anthropic as a provider in your organization or project AI providers.
  1. Visit Anthropic’s Console and create a new API key.
  2. Go to Settings > AI providers.
  3. Click Organization provider or Project provider, depending on whether you want the provider to be available across every project in the organization or just the current project.
  4. Under Model providers, click Anthropic.
  5. Choose your authentication method:
    • API key: Paste an Anthropic API key into the Secret field.
      API keys are stored as one-way cryptographic hashes, never in plaintext.
    • Workload identity federation: Exchange a Braintrust-signed JWT for an Anthropic access token, instead of storing a long-lived Anthropic API key in Braintrust.
      Workload identity federation is available only for organization-level providers on Braintrust-hosted organizations. Project-level providers and self-hosted deployments must use API key authentication.
  6. If you chose Workload identity federation, use the setup values shown in Braintrust to configure Anthropic:
    1. Create an Anthropic service account. Copy the svac_... service account ID.
    2. Register the Braintrust issuer in Anthropic. Use the Issuer URL shown in Braintrust, set JWKS source to OIDC discovery, leave Discovery base URL blank, turn Single-use tokens on, and set Max token lifetime to 1 hour.
    3. Create a federation rule in Anthropic. Use the Subject pattern, Expected audience, and Required claims shown in Braintrust. Select the service account from the previous step and the Anthropic workspace Braintrust should use.
    4. Paste the Anthropic IDs back into Braintrust:
    • Federation rule ID: The fdrl_... value in Anthropic’s Workload identity > Rules table.
    • Organization ID: The ID shown on Anthropic’s Organization settings > Organization page.
    • Service account ID: The svac_... ID from the Anthropic service account.
    • Workspace ID: Use default for Anthropic’s default workspace, or the workspace ID selected in the federation rule.
    • Subject suffix: A stable suffix for this Anthropic connection. It must match the final part of the subject pattern used in Anthropic.
    For general Anthropic concepts and Console details, see Anthropic’s workload identity federation docs.
  7. Click Save.