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

# Anthropic SDK

> Use Anthropic-compatible clients with Phaseo.

Use the Anthropic-compatible API when your app, agent, or coding tool expects Claude-style `/v1/messages` requests.

## TypeScript

```bash theme={null}
npm install @anthropic-ai/sdk
```

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

const client = new Anthropic({
	apiKey: process.env.PHASEO_API_KEY,
	baseURL: "https://api.phaseo.ai",
});

const message = await client.messages.create({
	model: "anthropic/claude-sonnet-4.5",
	max_tokens: 512,
	messages: [{ role: "user", content: "Reply with only: ok" }],
});

console.log(message.content);
```

## Python

```bash theme={null}
pip install anthropic
```

```python theme={null}
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ["PHASEO_API_KEY"],
    base_url="https://api.phaseo.ai",
)

message = client.messages.create(
    model="anthropic/claude-sonnet-4.5",
    max_tokens=512,
    messages=[{"role": "user", "content": "Reply with only: ok"}],
)

print(message.content)
```

## Notes

* Use the root host `https://api.phaseo.ai`; Anthropic clients append `/v1/messages`.
* Use [Anthropic Messages](../../api-reference/endpoint/anthropic-messages.mdx) for endpoint details.
* Native Anthropic tool shapes can work where Phaseo supports them, but cross-provider server tools should use Phaseo tool names.
* If a workflow depends on streamed tool loops, test it before production rollout because Anthropic-compatible clients are stricter about tool event ordering.

## Related

* [Claude Code](./claude-code.mdx)
* [Anthropic Messages](../../api-reference/endpoint/anthropic-messages.mdx)
* [Tool Calling](../tool-calling.mdx)
