---
title: "Working with Anthropic in Pixeltable"
description: "Pixeltable's Anthropic integration enables you to access Anthropic's Claude LLM via the Anthropic API."
url: "https://www.pixeltable.com/notebooks/working-with-anthropic"
updated: "2026-10-06"
---

# Working with Anthropic in Pixeltable

Pixeltable's Anthropic integration enables you to access Anthropic's Claude LLM via the Anthropic API.

- **Type:** Notebook
- **Group:** Providers

## What it uses

- **Install:** `pip install pixeltable anthropic`
- **Environment variables it names:** `ANTHROPIC_API_KEY`
- **Pixeltable calls:** `anthropic.messages()`, `pxt.create_table()`, `add_computed_column()`, `insert()`

## A look at the code

```python
from pixeltable.functions import anthropic

# Create a table in Pixeltable and add a computed column that calls Anthropic

t = pxt.create_table('anthropic_demo/chat', {'input': pxt.String})

msgs = [{'role': 'user', 'content': t.input}]
t.add_computed_column(
    output=anthropic.messages(
        messages=msgs,
        model='claude-haiku-4-5-20251001',
        max_tokens=300,
        model_kwargs={
            # Optional dict with parameters for the Anthropic API
            'system': 'Respond to the prompt with detailed historical information.'
        },
    )
)
```

## Open it

- **Open in Colab:** https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/providers/working-with-anthropic.ipynb
- **Docs page:** https://docs.pixeltable.com/howto/providers/working-with-anthropic
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/howto/providers/working-with-anthropic.ipynb
