> For the complete documentation index, see [llms.txt](https://help.ztrax.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.ztrax.co/api/shi-yong-zhi-nan/clients.md). Agents can also search and read this documentation through its [MCP server](https://help.ztrax.co/~gitbook/mcp).

# 接入常用工具

在 Cherry Studio、Claude Code、Codex、翻译插件等常用工具里填写 Ztrax API 地址和 Key。

所有工具都只需要两样东西：**API 地址**和 **API Key**。还没有 Key 的先看 [快速开始](https://help.ztrax.co/api/readme.md)。

{% hint style="info" %}
**一键导入：** 在「令牌管理」列表里，令牌那一行的「聊天」下拉菜单可以直接把地址和 Key 填进 Cherry Studio、CC Switch、DeepChat、Lobe Chat 等客户端，不用手动复制。
{% endhint %}

{% tabs %}
{% tab title="Cherry Studio 等聊天客户端" %}
Cherry Studio、ChatBox、LobeChat、NextChat 等，选 **OpenAI 兼容**（或「自定义 OpenAI」）类型的服务商：

| 设置项               | 填写                                                                          |
| ----------------- | --------------------------------------------------------------------------- |
| API 地址 / Base URL | `https://api.ztrax.co`（软件会自动补 `/v1`；如果它要求完整地址，就填 `https://api.ztrax.co/v1`） |
| API Key           | 你的令牌 `sk-...`                                                               |
| 模型                | 点「获取模型列表」，或者手动添加在模型广场复制的模型名                                                 |

填完点「检查」或发一句话测试。
{% endtab %}

{% tab title="Claude Code" %}
Claude Code 使用 Claude 原生格式，地址**不要**带 `/v1`。

**Windows（PowerShell）：**

```powershell
$env:ANTHROPIC_BASE_URL = "https://api.ztrax.co"
$env:ANTHROPIC_AUTH_TOKEN = "sk-你的令牌"
claude
```

**macOS / Linux：**

```bash
export ANTHROPIC_BASE_URL="https://api.ztrax.co"
export ANTHROPIC_AUTH_TOKEN="sk-你的令牌"
claude
```

想长期生效，可以写进 `~/.claude/settings.json`：

```json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.ztrax.co",
    "ANTHROPIC_AUTH_TOKEN": "sk-你的令牌"
  }
}
```

也可以用 **CC Switch** 管理：在令牌的「聊天」菜单里选 CC Switch 一键导入。
{% endtab %}

{% tab title="Codex CLI" %}
编辑 `~/.codex/config.toml`（Windows 在 `C:\Users\你的用户名\.codex\config.toml`）：

```toml
model_provider = "ztrax"
model = "在模型广场复制的模型名"

[model_providers.ztrax]
name = "Ztrax API"
base_url = "https://api.ztrax.co/v1"
env_key = "ZTRAX_API_KEY"
wire_api = "responses"
```

再设置环境变量 `ZTRAX_API_KEY` 为你的令牌，运行 `codex` 即可。
{% endtab %}

{% tab title="沉浸式翻译 / 流畅阅读" %}
翻译服务选「OpenAI」或「自定义 OpenAI 兼容」：

* 自定义 API 接口地址：`https://api.ztrax.co/v1/chat/completions`
* API Key：你的令牌
* 模型：填模型广场里的模型名（翻译用便宜、快的小模型就够了）
  {% endtab %}
  {% endtabs %}

{% hint style="info" %}
没有你用的软件？只要它支持「OpenAI 兼容」或「自定义 API 地址」，就填 `https://api.ztrax.co/v1` 和你的令牌。
{% endhint %}
