---
title: Anthropic
description: Claude via the official SDK.
---

# Anthropic

Official `anthropic` / `@anthropic-ai/sdk`. Same rule: import, then `init()`.

```python
import anthropic
import agenko

agenko.init()
client = anthropic.Anthropic()

@agenko.check
def answer(question: str) -> str:
    msg = client.messages.create(
        model="claude-sonnet-4-5",
        max_tokens=1024,
        messages=[{"role": "user", "content": question}],
    )
    return msg.content[0].text
```

```typescript
import Anthropic from "@anthropic-ai/sdk";
import agenko from "@agenko/sdk";

agenko.init();
const client = new Anthropic();

const answer = agenko.check(async (question: string) => {
  const msg = await client.messages.create({
    model: "claude-sonnet-4-5",
    max_tokens: 1024,
    messages: [{ role: "user", content: question }],
  });
  const block = msg.content[0];
  return block.type === "text" ? block.text : "";
});
```

Tool-use blocks show up as TOOL spans. Pair with `@agenko.check(claims="...")` when the model is supposed to call a specific tool.

Drop-in: `agenko.anthropic`.

## Agent instructions

This page: https://docs.agenko.app/anthropic.md

Fetch `/llms.txt` for the full index. Search: `GET /api/search-docs?query=...`
