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

> Replace a LiteLLM proxy with Phaseo while preserving the OpenAI-compatible request path your application already uses.

Use this guide when your application calls a LiteLLM proxy through an OpenAI-compatible client. Swap the proxy boundary first, then map aliases, routing rules, and shared defaults deliberately.

## What changes

| Setting | Before | After |
| - | - | - |
| Base URL | Your LiteLLM proxy | `https://api.phaseo.app/v1` |
| API key | LiteLLM proxy key | `PHASEO_API_KEY` |
| Model aliases | LiteLLM configuration | Phaseo model IDs or application aliases |
| Routing defaults | LiteLLM configuration | Phaseo presets and routing settings |

**1. Inventory the proxy configuration**

List every model alias, fallback, provider rule, retry policy, budget, callback, and environment variable used by the current LiteLLM deployment. Identify which settings are shared policy and which belong to a single application.

**2. Replace the proxy endpoint**

Keep the OpenAI-compatible request code and change its base URL and key.

```typescript TypeScript theme={null}
import OpenAI from "openai";

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

const response = await client.chat.completions.create({
  model: "openai/gpt-4.1-mini",
  messages: [{ role: "user", content: "Reply with: migration ready" }],
});
```

```python Python theme={null}
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["PHASEO_API_KEY"],
    base_url="https://api.phaseo.app/v1",
)
```

```bash cURL theme={null}
curl https://api.phaseo.app/v1/chat/completions \
  -H "Authorization: Bearer $PHASEO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4.1-mini",
    "messages": [{"role": "user", "content": "Reply with: migration ready"}]
  }'
```

**3. Map aliases and routing rules**

Verify every production model against `GET /v1/models`. If callers rely on internal aliases, normalize them in one application boundary instead of editing every request.

Move reusable prompt, parameter, and provider restrictions into [Presets](https://phaseo.app/docs/v1/guides/presets.md). Configure provider ranking and fallbacks through [Routing and Fallbacks](https://phaseo.app/docs/v1/guides/routing-and-fallbacks.md).

**4. Validate the production workflows**

Test streaming, tools, structured outputs, retries, error mapping, and any callback-driven observability your LiteLLM deployment handled. Compare latency, output, token usage, and cost before moving traffic gradually.

## Migration checklist

* LiteLLM URLs, keys, and deployment dependencies have been identified.
* Every production model and alias has an explicit Phaseo mapping.
* Shared defaults have moved to presets or one application boundary.
* Streaming, tools, and structured outputs pass in staging where used.
* Required callbacks and telemetry have an intentional replacement.
* Rollback remains a configuration-only endpoint and key change.

## Next steps

* [Presets](https://phaseo.app/docs/v1/guides/presets.md)
* [Routing and Fallbacks](https://phaseo.app/docs/v1/guides/routing-and-fallbacks.md)
* [Observability](https://phaseo.app/docs/v1/guides/integrations/observability.md)


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