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

# Pin or ignore providers per request

> Use request-level provider controls to prefer one provider order, constrain the pool, or remove a provider from consideration.

Use this recipe when one request should prefer a specific provider path without changing your workspace-wide routing defaults.

## Goal

* Try providers in a preferred order.
* Restrict a request to an approved provider subset.
* Ignore one provider temporarily without editing presets.

## 1. Try providers in a specific order

Use `provider.order` when you already know the preferred route sequence.

```bash cURL theme={null}
curl https://api.phaseo.app/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "anthropic/claude-opus-4.6",
    "input": "Write a concise launch summary.",
    "provider": {
      "order": ["anthropic-us", "anthropic"]
    }
  }'
```

```typescript TypeScript SDK theme={null}
import Phaseo from "@phaseo/sdk";

const client = new Phaseo({ apiKey: process.env.PHASEO_API_KEY! });

const response = await client.generateResponse({
  model: "anthropic/claude-opus-4.6",
  input: "Write a concise launch summary.",
  provider: {
    order: ["anthropic-us", "anthropic"],
  },
});

console.log(response.output_text);
```

```python Python SDK theme={null}
from phaseo import Phaseo

client = Phaseo(api_key="YOUR_API_KEY")

response = client.generate_response(
    {
        "model": "anthropic/claude-opus-4.6",
        "input": "Write a concise launch summary.",
        "provider": {
            "order": ["anthropic-us", "anthropic"],
        },
    }
)

print(response.get("output_text"))
```

This puts the listed providers first in the candidate order before the rest of the eligible pool.

## 2. Restrict the request to a fixed provider subset

Use `provider.only` when the request must stay inside one small allow list.

```bash cURL theme={null}
curl https://api.phaseo.app/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.4-nano",
    "input": "Extract the action items.",
    "provider": {
      "only": ["openai", "openai-eu"],
      "sort": "price"
    }
  }'
```

```typescript TypeScript SDK theme={null}
import Phaseo from "@phaseo/sdk";

const client = new Phaseo({ apiKey: process.env.PHASEO_API_KEY! });

const response = await client.generateResponse({
  model: "openai/gpt-5.4-nano",
  input: "Extract the action items.",
  provider: {
    only: ["openai", "openai-eu"],
    sort: "price",
  },
});

console.log(response.output_text);
```

```python Python SDK theme={null}
from phaseo import Phaseo

client = Phaseo(api_key="YOUR_API_KEY")

response = client.generate_response(
    {
        "model": "openai/gpt-5.4-nano",
        "input": "Extract the action items.",
        "provider": {
            "only": ["openai", "openai-eu"],
            "sort": "price",
        },
    }
)

print(response.get("output_text"))
```

This keeps the request inside those providers and then applies the chosen ranking mode inside that subset.

## 3. Remove one provider from consideration

Use `provider.ignore` when one provider should be skipped for a request or short-lived rollout.

```bash cURL theme={null}
curl https://api.phaseo.app/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "meta/llama-4-maverick",
    "input": "Summarize the transcript.",
    "provider": {
      "ignore": ["deepinfra"]
    }
  }'
```

```typescript TypeScript SDK theme={null}
import Phaseo from "@phaseo/sdk";

const client = new Phaseo({ apiKey: process.env.PHASEO_API_KEY! });

const response = await client.generateResponse({
  model: "meta/llama-4-maverick",
  input: "Summarize the transcript.",
  provider: {
    ignore: ["deepinfra"],
  },
});

console.log(response.output_text);
```

```python Python SDK theme={null}
from phaseo import Phaseo

client = Phaseo(api_key="YOUR_API_KEY")

response = client.generate_response(
    {
        "model": "meta/llama-4-maverick",
        "input": "Summarize the transcript.",
        "provider": {
            "ignore": ["deepinfra"],
        },
    }
)

print(response.get("output_text"))
```

This is useful when:

* one provider is degraded
* you are validating another provider path
* you want to compare routing outcomes without editing a preset

## 4. Combine the controls carefully

You can combine these controls, but keep the intent simple:

* use `order` to express preference
* use `only` to enforce the candidate pool
* use `ignore` to carve one provider out

One practical pattern combines:

* `only` to keep the request inside `google-vertex` and `google-vertex-eu`
* `order` to prefer `google-vertex-eu` first
* `sort: "latency"` to rank inside that allowed set

## 5. When to move this into a preset

If the same provider rules appear in multiple services, stop copying them per request and move them into a preset instead.

Use request-level routing when the override is:

* temporary
* caller-specific
* tied to one user flow

## Related guides

* [Routing and Fallbacks](https://phaseo.app/docs/v1/guides/routing-and-fallbacks.md)
* [Roll out presets and debug routing](https://phaseo.app/docs/v1/cookbook/preset-rollout-and-routing-debug.md)


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