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

# OpenClaw

> 将 Phaseo 注册为 OpenClaw 模型提供商，密钥从 Phaseo CLI 读取。

运行 `phaseo openclaw`，在 OpenClaw 中注册一个包含所有兼容 Phaseo 模型的 `phaseo` 模型提供商；或者自己用 `openclaw config set` 添加该提供商。

## 使用 Phaseo CLI 设置

```bash theme={null}
phaseo login
phaseo openclaw --model openai/gpt-6-astra
```

如果没有安装 OpenClaw，CLI 会显示安装命令（`npm install -g openclaw@latest`，或用 pnpm、Yarn 或 Bun 安装同一个包），并在运行前征求你的确认。随后 setup 会运行两次 `openclaw config set`：

* **`secrets.providers.phaseo_cli`**：一个 exec 机密提供程序，运行 `phaseo integrations credential openclaw` 来读取密钥。密钥从不写入 OpenClaw 的配置。
* **`models.providers.phaseo`**：一个提供商，Base URL 为 `https://api.phaseo.app/v1`，API 类型为 `openai-completions`，密钥取自 `phaseo_cli`。它列出所有支持 Chat Completions 的活跃 Phaseo 文本模型，`--model` 的值排在首位（未指定时为 `anthropic/claude-sonnet-4.6`）。

该密钥是一个 `Phaseo CLI: OpenClaw API Key`，90 天后过期，每月支出上限为 \$100。密钥过期后，当 OpenClaw 向 CLI 请求密钥时，CLI 会创建一个新密钥。

setup 不会更改 OpenClaw 的默认模型。准备好之后，用 `openclaw models set` 选择 Phaseo 模型。使用 `--catalog default` 可以只注册所选模型。

## 手动配置 OpenClaw

先注册一个输出你的密钥的机密提供程序，再注册 Phaseo 模型提供商：

```bash theme={null}
openclaw config set secrets.providers.phaseo_cli \
  '{"source":"exec","command":"phaseo","args":["integrations","credential","openclaw"],"jsonOnly":false}' \
  --strict-json

openclaw config set models.providers.phaseo '{
  "baseUrl": "https://api.phaseo.app/v1",
  "apiKey": { "source": "exec", "provider": "phaseo_cli", "id": "value" },
  "api": "openai-completions",
  "models": [
    { "id": "openai/gpt-6-astra", "name": "openai/gpt-6-astra via Phaseo", "reasoning": false, "input": ["text"] }
  ]
}' --strict-json
```

`models` 中的每个条目包含 `id`（Phaseo 模型 ID）、`name`、`reasoning`、`input`（`text`、`image`）以及可选的 `contextWindow`。为每个希望在 OpenClaw 中列出的 Phaseo 模型添加一个条目。

## 确认可以正常使用

运行 `openclaw config get models.providers.phaseo --json`，确认提供商已注册。用 `openclaw models set` 选择一个 Phaseo 模型，并发送一条简短的提示词。确认该请求出现在 **设置 → 用量 → 日志** 中。

## 移除 Phaseo

```bash theme={null}
phaseo integrations remove openclaw
```

此命令会取消设置 `models.providers.phaseo` 和 `secrets.providers.phaseo_cli`，然后吊销密钥。你的其他 OpenClaw 设置保持不变。如果 OpenClaw 网关正在运行，请重启它。

## 解决常见问题

| 问题 | 解决方法 |
| - | - |
| `OpenClaw already defines models.providers.phaseo` | setup 不会覆盖已有的 `phaseo` 提供商。删除或重命名它，或运行 `phaseo integrations remove openclaw`，然后重新设置。 |
| 移动或重新安装 Phaseo CLI 或 Node.js 后请求失败 | setup 会把 Node.js 和 CLI 的确切路径保存在 `secrets.providers.phaseo_cli` 中。运行 `phaseo integrations remove openclaw`，然后再次运行 `phaseo openclaw`。 |
| `OpenClaw is not installed or is not on PATH` | 安装 OpenClaw 或把它添加到 `PATH`，然后重新运行 setup。 |
| 模型被拒绝 | 用 [Models 端点](https://phaseo.app/docs/zh-Hans/v1/api-reference/endpoint/models.md)核对准确的 ID。 |

其他智能体以及每个智能体都需要的提供商值，请参阅[编程智能体](https://phaseo.app/docs/zh-Hans/v1/guides/integrations/coding-assistants.md)。


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