# Connect Anthropic to Unsloth: Run Claude Models in Local Chat

Connect the Anthropic API to [Unsloth](https://github.com/unslothai/unsloth) to chat with Claude models including Claude Opus 4.7 directly alongside your local models in an open-source UI chat interface. This guide shows you how to create an Anthropic API key, add Anthropic as a provider in Unsloth, load Claude LLMs, and start chatting.

Supported Claude models in Unsloth can also access advanced features such as thinking controls, provider-side web search, Anthropic code execution, and prompt caching to improve reasoning, workflows, latency, and cost efficiency.

### Setup

{% stepper %}
{% step %}

#### Create an Anthropic API key

Create an API key from the [Anthropic Console](https://console.anthropic.com/settings/keys). Copy the key. You will paste it into Unsloth in the next step.
{% endstep %}

{% step %}

#### Connect Anthropic to Unsloth

<figure><img src="/files/Jer4OMpyRKNurl0xjZOd" alt="" width="563"><figcaption></figcaption></figure>

Next, connect Anthropic to Unsloth.

1. Open **Settings** → **Connections**, then click **Add Provider.**
2. Select the provider you want to add, then paste the API key you copied earlier.
3. Click **Reload Models** to refresh the list with models available to your account.
4. Choose the models you want to enable, then hit save.&#x20;

#### Ready to Chat

After saving the connection, select a Claude model under **External** in the model dropdown.

<figure><img src="/files/LuODDubUnxNX700szMOk" alt="" width="373"><figcaption></figcaption></figure>

Supported Claude models can expose extra controls in chat, including thinking, web search, code execution, and prompt caching.
{% endstep %}
{% endstepper %}

### Web Search & Thinking

Supported Claude models can use provider-side web search.

The **Think** control appears when the selected model supports thinking. Depending on the model, this may expose different thinking levels or availability.

<figure><img src="/files/9hxbjfC8Cjif2CPpcAlG" alt="" width="563"><figcaption></figcaption></figure>

The **Think** control adapts to the selected model: some models use an on/off toggle, while reasoning-effort models use model specific thinking levels.&#x20;

### Code Execution

When enabled, supported Claude models can run code in Anthropic’s provider sandbox to solve problems, analyze data, and work with files.

<figure><img src="/files/u855tCuYk5dXEqW74c2y" alt="" width="563"><figcaption></figcaption></figure>

Claude uses Anthropic’s Code execution tool. Code execution appears in the response timeline as tool activity, alongside other tool calls.

### Prompt Caching

Prompt caching reduces latency and cost when requests reuse the same long prefix. It is supported for compatible providers and servers, including Anthropic models.

<figure><img src="/files/rd7uqDkUz6YnddW01aRl" alt=""><figcaption></figcaption></figure>

Use the **Prompt caching** setting in the side panel to control caching behaviour for supported connections.

### Troubleshooting

If Anthropic API fails to connect, check that the API key is valid and belongs to the correct Anthropic account.

If a model does not appear after clicking **Load Models**, it may not be available for your account. You can enter the model ID manually or choose another model.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://unsloth.ai/docs/integrations/connections/anthropic-claude.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
