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

# Anthropic

> Integrate Anthropic Claude models through the Adaline Proxy for automatic telemetry and observability.

# Anthropic

Integrate Anthropic Claude models through the Adaline Proxy to automatically capture telemetry — requests, responses, token usage, latency, and costs — with minimal code changes.

## Supported Models

**Chat Models**

| Model | Description |
| - | - |
| `claude-opus-4-6` | Latest Opus model |
| `claude-opus-4-5-20251101` | Claude Opus 4.5 |
| `claude-4-opus-20250514` | Claude 4 Opus |
| `claude-sonnet-4-6` | Latest Sonnet model |
| `claude-sonnet-4-5-20250929` | Claude Sonnet 4.5 |
| `claude-4-sonnet-20250514` | Claude 4 Sonnet |
| `claude-haiku-4-5-20251001` | Claude Haiku 4.5 |
| `claude-3-7-sonnet-20250219` | Claude 3.7 Sonnet with extended thinking |
| `claude-3-5-sonnet-20241022` | Claude 3.5 Sonnet v2 |
| `claude-3-5-sonnet-20240620` | Claude 3.5 Sonnet v1 |
| `claude-3-5-haiku-20241022` | Fast and compact Claude 3.5 |
| `claude-3-opus-20240229` | Claude 3 Opus |
| `claude-3-sonnet-20240229` | Claude 3 Sonnet |
| `claude-3-haiku-20240307` | Fastest Claude 3 model |

**Embedding Models (Voyage)**

| Model | Description |
| - | - |
| `voyage-3` | General-purpose embeddings |
| `voyage-3-lite` | Lightweight embeddings |
| `voyage-code-2` | Optimized for code |
| `voyage-law-2` | Optimized for legal text |
| `voyage-multilingual-2` | Multilingual embeddings |
| `voyage-finance-2` | Optimized for financial text |

## Proxy Base URL

```
https://gateway.adaline.ai/v1/anthropic/
```

## Prerequisites

1. An [Anthropic API key](https://console.anthropic.com/settings/keys)
2. An [Adaline API key](https://www.adaline.ai/docs/admin/create-api-keys.md), project ID, and prompt ID

## Chat Completions

### Complete Chat

```python Python theme={null}
import anthropic

client = anthropic.Anthropic(
    api_key="your-anthropic-api-key",
    base_url="https://gateway.adaline.ai/v1/anthropic/"
)

headers = {
    "adaline-api-key": "your-adaline-api-key",
    "adaline-project-id": "your-project-id",
    "adaline-prompt-id": "your-prompt-id"
}

response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1000,
    messages=[
        {"role": "user", "content": "What is artificial intelligence?"}
    ],
    extra_headers=headers
)

print(response.content[0].text)
```

```typescript TypeScript theme={null}
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: "your-anthropic-api-key",
  baseURL: "https://gateway.adaline.ai/v1/anthropic/",
});

const response = await client.messages.create(
  {
    model: "claude-3-5-sonnet-20241022",
    max_tokens: 1000,
    messages: [
      { role: "user", content: "What is artificial intelligence?" },
    ],
  },
  {
    headers: {
      "adaline-api-key": "your-adaline-api-key",
      "adaline-project-id": "your-project-id",
      "adaline-prompt-id": "your-prompt-id",
    },
  }
);

console.log(response.content[0].text);
```

### Stream Chat

```python Python theme={null}
import anthropic

client = anthropic.Anthropic(
    api_key="your-anthropic-api-key",
    base_url="https://gateway.adaline.ai/v1/anthropic/"
)

headers = {
    "adaline-api-key": "your-adaline-api-key",
    "adaline-project-id": "your-project-id",
    "adaline-prompt-id": "your-prompt-id"
}

stream = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1000,
    messages=[
        {"role": "user", "content": "Explain the theory of relativity in simple terms."}
    ],
    stream=True,
    extra_headers=headers
)

for event in stream:
    if event.type == "content_block_delta":
        print(event.delta.text, end="")
```

```typescript TypeScript theme={null}
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: "your-anthropic-api-key",
  baseURL: "https://gateway.adaline.ai/v1/anthropic/",
});

const stream = client.messages.stream(
  {
    model: "claude-3-5-sonnet-20241022",
    max_tokens: 1000,
    messages: [
      { role: "user", content: "Explain the theory of relativity in simple terms." },
    ],
  },
  {
    headers: {
      "adaline-api-key": "your-adaline-api-key",
      "adaline-project-id": "your-project-id",
      "adaline-prompt-id": "your-prompt-id",
    },
  }
);

for await (const event of stream) {
  if (event.type === "content_block_delta" && event.delta.type === "text_delta") {
    process.stdout.write(event.delta.text);
  }
}
```

## Optional Headers

Customize tracing behavior with optional headers:

```python theme={null}
headers = {
    # Required
    "adaline-api-key": "your-adaline-api-key",
    "adaline-project-id": "your-project-id",
    "adaline-prompt-id": "your-prompt-id",
    # Optional
    "adaline-trace-name": "anthropic-chat-completion",
    "adaline-trace-session-id": "user-session-123",
    "adaline-span-name": "claude-sonnet-call",
}
```

See the full [Headers Reference](https://www.adaline.ai/docs/reference/proxy/headers.md) for all available options.

## Next Steps

* [Multi-Step Workflows](https://www.adaline.ai/docs/integrations/examples/multi-step-workflows.md) — RAG pipelines, multi-step generation, and conversational agents
* [Headers Reference](https://www.adaline.ai/docs/reference/proxy/headers.md) — Complete header documentation

***

> [card] [Back to Integrations](https://www.adaline.ai/docs/integrations/introduction.md)
>
> Browse all integrations


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.