> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-server/instance-administration/ai-features/llm-providers/anthropic.md).

# Anthropic

Register Anthropic as an LLM provider on SonarQube Server 2026.5, using your own Anthropic API key.

Use the **Anthropic** provider type to reach Anthropic's own API directly, authenticated with your Anthropic API key.

To select this provider and choose a model for an AI agent, see [LLM providers](/sonarqube-server/instance-administration/ai-features/llm-providers.md#selecting-for-a-capability); for the steps that apply to every provider type, see [LLM providers](/sonarqube-server/instance-administration/ai-features/llm-providers.md).

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* An Anthropic API key with access to the models you want to use.

## Fields <a href="#fields" id="fields"></a>

| Field       | Required | What to enter           |
| ----------- | -------- | ----------------------- |
| **API key** | Yes      | Your Anthropic API key. |

SonarQube Server already knows Anthropic's endpoint (`https://api.anthropic.com/v1`) and sends the required `anthropic-version` header for you, so neither is exposed as a field.

To reach Anthropic through a gateway or proxy instead of its own API, register a **Custom** provider instead; see [Custom](/sonarqube-server/instance-administration/ai-features/llm-providers/custom.md). If that gateway forwards to Anthropic's own endpoint rather than translating the request itself, add the `anthropic-version` header yourself under **Custom headers**; see [Custom](/sonarqube-server/instance-administration/ai-features/llm-providers/custom.md#header-authentication).

## What happens when you save <a href="#saving" id="saving"></a>

SonarQube Server tests the connection when you save, the same as for Custom and Azure AI Foundry. If the test fails, SonarQube Server does not add the provider, and the form reports the problem.

## Entering the model identifier <a href="#model-identifier" id="model-identifier"></a>

1. Find the model in Anthropic's model catalog.
2. Copy the identifier exactly as Anthropic names it, for example `claude-opus-4-6`.
3. Go to the agent's page under **Administration** > **Configuration** > **AI capabilities**, paste the identifier into the model field, and select **Save**.

If adding the provider fails, see [LLM providers](/sonarqube-server/instance-administration/ai-features/llm-providers.md#troubleshooting).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-server/instance-administration/ai-features/llm-providers/anthropic.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
