# Migrating from Anthropic

Source: https://staging-docs.aiand.com/migrating-anthropic/

The ai& Inference API exposes Anthropic-compatible endpoints alongside its OpenAI surface. If you're using the `anthropic` SDK, you can migrate by changing the **base URL** and the **API key**.

<Aside type="note">
  You will be calling open-weight models hosted on ai& infrastructure — not Claude. The `anthropic` SDK speaks to ai& through the Anthropic wire format, but the model behind it is whichever entry you select from the [Catalog](/models/catalog/).
</Aside>

## Change two things

<Tabs>
<TabItem label="Python">

```python
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.aiand.com",
    api_key="sk-your-aiand-api-key",
)
```

</TabItem>
<TabItem label="Node.js">

```ts

const client = new Anthropic({
  baseURL: "https://api.aiand.com",
  apiKey: "sk-your-aiand-api-key",
});
```

</TabItem>
</Tabs>

The `anthropic-version` header the SDK sends automatically tells ai& to respond with Anthropic-shape payloads — including on the dual-shape Files endpoints.

## Supported endpoints

| Anthropic endpoint | ai& path | Notes |
|--------------------|----------|-------|
| `/v1/messages` | [Messages](/api/messages/) | Streaming + tool use + vision |
| `/v1/files` | [Files](/api/files/) | Anthropic shape selected by `anthropic-version` header |

## What's different

- **API keys** start with `sk-` (not `sk-ant-`) — see [Authentication](/authentication/).
- **Model IDs** differ from Anthropic's. List them via the [catalog](/models/catalog/) or `client.models.list()` on the OpenAI surface.

<Aside type="tip">
  You can use both the `openai` SDK and the `anthropic` SDK against ai& in the same project — they hit different endpoints but share the same API key, org, and billing.
</Aside>
