> ## 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.

> ## Agent Instructions
> Phaseo Gateway base URL: https://api.phaseo.app/v1. Send `Authorization: Bearer $PHASEO_API_KEY` with every request.
> Model IDs look like `provider/model`, for example `openai/gpt-6-astra`. Do not guess IDs: list them with `GET /v1/models` or check https://phaseo.app/models. `phaseo/free` routes to an available free model and needs no wallet balance.
> For new text integrations prefer `POST /v1/responses`. `POST /v1/chat/completions` (OpenAI format) and `POST /v1/messages` (Anthropic format) suit existing code.
> The full API contract is https://phaseo.app/docs/openapi/v1/openapi.yaml. Official SDKs: `@phaseo/sdk` (TypeScript) and `phaseo` (Python), plus Go, C#, PHP, Ruby and Rust.
> Search these docs over MCP at https://phaseo.app/docs/mcp, and install Phaseo skills with `npx skills add https://phaseo.app/docs`. If a page is wrong or out of date, report it with the MCP `submit_feedback` tool.
> Manage Phaseo accounts with the `phaseo` CLI (`npm install -g @phaseo/cli`, then `phaseo login` or `phaseo login --device-code`), the `/v1` Management API or the MCP server at `https://mcp.phaseo.app/mcp?access=manage`. Do not send users to the dashboard for account tasks. A person is still needed for sign-up, approving a sign-in, paying the first top-up on the checkout link that `phaseo credits add` returns when no card is saved, confirming each saved-card top-up from the emailed link, and account security (password, MFA, passkeys). Create API keys with `phaseo keys create --name <name> --json`; never guess one. Credit top-ups need `phaseo login --scopes billing:write` first. Task map: https://phaseo.app/docs/v1/developers/manage-from-an-agent.md.

# Migrating from Anthropic SDK

> Move an Anthropic SDK integration to Phaseo while keeping the Messages API workflow familiar.

Use this guide to keep your Anthropic SDK workflow while moving requests through Phaseo. Change the client configuration first, then verify model IDs and the Anthropic-specific behavior your application depends on.

## What changes

| Setting | Before | After |
| - | - | - |
| Base URL | Anthropic default | `https://api.phaseo.app` |
| API key | Anthropic key | `PHASEO_API_KEY` |
| Model | Anthropic model name | A Phaseo model ID returned by `GET /v1/models` |
| Messages call | Existing SDK call | Usually unchanged |

**1. Create a Phaseo API key**

Create a key with `phaseo keys create` in the [Phaseo CLI](https://phaseo.app/docs/v1/guides/integrations/phaseo-cli.md) or in [Gateway Keys](https://phaseo.app/settings/keys) and make it available to your application as `PHASEO_API_KEY`.

**2. Update the Anthropic client**

Point the SDK at the Phaseo root host, `https://api.phaseo.app`, and pass your Phaseo key as `authToken` (`auth_token` in Python). The SDK adds `/v1/messages` itself and sends the key as `Authorization: Bearer`. Remove `ANTHROPIC_API_KEY` from environments that now call Phaseo, so older SDK versions don't also send your Anthropic key.

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

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

const response = await client.messages.create({
  model: "anthropic/claude-sonnet-4.6",
  max_tokens: 256,
  messages: [{ role: "user", content: "Reply with: migration ready" }],
});
```

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

client = anthropic.Anthropic(
    auth_token=os.environ["PHASEO_API_KEY"],
    base_url="https://api.phaseo.app",
)

response = client.messages.create(
    model="anthropic/claude-sonnet-4.6",
    max_tokens=256,
    messages=[{"role": "user", "content": "Reply with: migration ready"}],
)
```

```bash cURL theme={null}
curl https://api.phaseo.app/v1/messages \
  -H "Authorization: Bearer $PHASEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-sonnet-4.6",
    "max_tokens": 256,
    "messages": [{"role": "user", "content": "Reply with: migration ready"}]
  }'
```

**3. Verify Anthropic-specific behavior**

Test system prompts, streaming, tool use, thinking or reasoning options, and structured output behavior with the exact models your application uses. Remove obsolete beta headers or request fields rather than carrying them into the new path blindly.

**4. Roll out gradually**

Compare a representative prompt set across both configurations. Check output shape, latency, token usage, errors, and cost before shifting production traffic.

## Migration checklist

* The Phaseo key is configured in every deployment environment.
* The Anthropic client points to `https://api.phaseo.app`.
* Every production model ID is verified against `GET /v1/models`.
* Streaming and tool-use flows pass in staging.
* Anthropic-specific beta headers and parameters have been reviewed.
* Rollback remains a configuration-only key and endpoint change.

## Next steps

* [Anthropic model migrations](https://phaseo.app/docs/v1/model-migrations.md)
* [Models](https://phaseo.app/docs/v1/exploring/models.md)
* [Tool Calling](https://phaseo.app/docs/v1/guides/tool-calling.md)


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