> ## Documentation Index
> Fetch the complete documentation index at: https://docs.responsibleailabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Anthropic Integration

> RAILAnthropic -- drop-in wrapper for Anthropic Claude.

## Installation

<CodeGroup>
  ```bash Python theme={null}
  pip install "rail-score-sdk[anthropic]"
  ```

  ```bash JavaScript theme={null}
  npm install @responsible-ai-labs/rail-score @anthropic-ai/sdk
  ```
</CodeGroup>

## Usage

<CodeGroup>
  ```python Python theme={null}
  import asyncio
  from rail_score_sdk.integrations import RAILAnthropic

  async def main():
      client = RAILAnthropic(
          anthropic_api_key="sk-ant-...",
          rail_api_key="YOUR_RAIL_API_KEY",
          rail_threshold=7.0,
          rail_policy="block",
      )

      response = await client.message(
          model="claude-sonnet-4-5-20250929",
          max_tokens=1024,
          messages=[{"role": "user", "content": "Explain quantum computing."}],
      )

      print(f"RAIL Score: {response.rail_score}/10")
      print(f"Threshold met: {response.threshold_met}")

  asyncio.run(main())
  ```

  ```typescript JavaScript theme={null}
  import { RAILAnthropic } from "@responsible-ai-labs/rail-score";

  const client = new RAILAnthropic({
    anthropicApiKey: "sk-ant-...",
    railApiKey: "YOUR_RAIL_API_KEY",
    railThreshold: 7.0,
  });

  const response = await client.message({
    model: "claude-sonnet-4-5-20250929",
    maxTokens: 1024,
    messages: [{ role: "user", content: "Explain quantum computing." }],
  });
  ```
</CodeGroup>
