> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/ai-workflows/cn/dai-li-ji-neng.md).

# 代理技能

使用适用于 Oxylabs 产品的官方 Agent Skills 来配置 AI 工具和编程助手。

Oxylabs 代理技能 (`skills.md`) 教会 LLM 和 AI 编码助手如何配置并与 Oxylabs 产品交互。安装技能后，你的助手会编写准确的连接字符串、请求载荷和自动化代码——不会出现语法或参数幻觉。

## 概览

Oxylabs 技能发布在两个仓库中：

<table><thead><tr><th width="188.6640625">仓库</th><th>涵盖的产品</th><th>所需凭据</th></tr></thead><tbody><tr><td><a href="https://github.com/oxylabs/web-api-skills">oxylabs/web-api-skills</a></td><td>Web API</td><td>Web API 密钥</td></tr><tr><td><a href="https://github.com/oxylabs/agent-skills">oxylabs/agent-skills</a></td><td>代理、Agent Browser、网页解锁器、Video Data、网页爬虫API</td><td>产品 <code>USERNAME</code> 和 <code>PASSWORD</code></td></tr></tbody></table>

{% hint style="info" %}
**注意：** 技能教会你的助手如何为 Oxylabs 产品编写代码。要让你的助手直接调用 Oxylabs 产品，请参阅 [模型上下文协议 (MCP)](/ai-workflows/cn/mcp.md).
{% endhint %}

## Web API 代理技能

一个单独的仓库，包含教你的代理使用 Oxylabs Web API 进行实时网页搜索和页面抓取的技能。

<table><thead><tr><th width="263.734375">技能</th><th>涵盖</th></tr></thead><tbody><tr><td><code>oxylabs-web-api</code></td><td>机制——MCP 工具、参数、延迟、错误、重试——以及一个无依赖的 CLI 辅助工具</td></tr><tr><td><code>oxylabs-web-research</code></td><td>研究方法：搜索、选择来源、阅读、引用</td></tr><tr><td><code>migrate-to-oxylabs</code></td><td>将代码库从 Tavily、Exa、Firecrawl、Perplexity、Brave 或 Linkup 迁移出来</td></tr></tbody></table>

### 安装

```bash
npx skills add oxylabs/web-api-skills
```

可与任何支持 skills 的代理配合使用。Claude Code 也可以将该仓库作为插件接入，从而连接这些技能和 [MCP 服务器](/ai-workflows/cn/mcp.md#web-api) 一起：

```
/plugin marketplace add oxylabs/web-api-skills
/plugin install oxylabs-web-api
```

然后 `export OXYLABS_WEB_API_KEY=<key>` ——在环境中设置，绝不要写入配置文件，并且来自一个 **Web API** 实例，而不是另一个 Oxylabs 产品——启动一个新会话，并运行 `/skills` 以确认三者都已加载。克隆并运行 `./install.sh` 如果你不想使用 npx，仍然可以正常工作； [README](https://github.com/oxylabs/web-api-skills#install) 其中包含该方法和手动复制。

### 技能还是 MCP？

它们分别解决不同的一半，并且可以很好地组合：

| 标准       | 技能                    | MCP 服务器     |
| -------- | --------------------- | ----------- |
| 为代理提供    | 判断力——何时搜索、信任哪些来源、如何引用 | 可直接调用的类型化工具 |
| 需要运行中的进程 | 否                     | 是           |
| 适用于      | 加载技能目录的代理             | 任何 MCP 客户端  |

同时安装两者是一个合理的默认选择。服务器打包了 `oxylabs-web-api` 并将其作为 `oxylabs://skill/web-api` 资源，因此仅连接它就能让代理获得两部分——当你希望在没有运行中服务器的情况下使用它们，或者当你想要时，单独安装这些技能 `migrate-to-oxylabs`.

### 故障排除

<table><thead><tr><th width="300.53515625">问题</th><th>解决方案</th></tr></thead><tbody><tr><td><code>401</code> 使用看起来有效的密钥时出错</td><td>该密钥几乎总是来自其他 Oxylabs 产品。创建一个 Web API 实例并为其生成密钥。</td></tr><tr><td><code>429</code> 出现错误，带有 <code>QUOTA_EXCEEDED</code></td><td>你的方案配额已用尽。重试也无济于事。</td></tr><tr><td>MCP 服务器在出现以下错误时失败： <code>找不到可执行文件：oxylabs-web-api-mcp</code></td><td>服务器未安装。运行 <code>uv tool install git+https://github.com/oxylabs/web-api-mcp</code>.</td></tr></tbody></table>

## Oxylabs 代理技能

一个仓库，包含用于代理、代理浏览器、网页解锁器、视频数据和网页爬虫API 的技能。你可以一次性安装它们，然后为你使用的产品添加凭据。

### 可用技能

通过 `skill/` 目录。

<table><thead><tr><th width="168.19140625">技能</th><th>描述</th><th data-hidden></th></tr></thead><tbody><tr><td><a href="https://github.com/oxylabs/agent-skills/blob/main/skills/proxies/SKILL.md"><code>代理</code></a></td><td>生成连接字符串，处理入口节点，并应用地理定向、IP 轮换和会话持久化。</td><td></td></tr><tr><td><a href="https://github.com/oxylabs/agent-skills/blob/main/skills/agent-browser/SKILL.md"><code>代理浏览器</code></a></td><td>通过 Chrome DevTools Protocol (CDP) 控制远程浏览器，配置指纹，并管理 Playwright 或 Puppeteer 自动化。</td><td></td></tr><tr><td><a href="https://github.com/oxylabs/agent-skills/blob/main/skills/web-unblocker/SKILL.md"><code>网页解锁器</code></a></td><td>将流量路由到正确的网关，管理自定义标头，切换 JavaScript 渲染，并配置 SSL。</td><td></td></tr><tr><td><a href="https://github.com/oxylabs/agent-skills/blob/main/skills/video-data/SKILL.md"><code>视频数据</code></a></td><td>提取视频元数据、字幕、搜索结果和频道数据，并通过高带宽代理下载视频或音频。</td><td></td></tr><tr><td><a href="https://github.com/oxylabs/agent-skills/blob/main/skills/web-scraper-api/SKILL.md"><code>网页爬虫API</code></a></td><td>构建请求负载、自定义解析参数和地理定向字段，并为 40+ 个目标格式化 JSON 输出。</td><td></td></tr></tbody></table>

该 `代理` 技能涵盖 [住宅](https://developers.oxylabs.io/products/proxies/residential-proxies), [移动](https://developers.oxylabs.io/products/proxies/mobile-proxies), [ISP](https://developers.oxylabs.io/products/proxies/isp-proxies), [专用 ISP](https://developers.oxylabs.io/products/proxies/dedicated-isp-proxies), [数据中心](https://developers.oxylabs.io/products/proxies/datacenter-proxies)，以及 [独享数据中心代理](https://developers.oxylabs.io/products/proxies/dedicated-datacenter-proxies).

### 安装

#### Claude Code（插件市场） <a href="#claude-code-plugin-marketplace" id="claude-code-plugin-marketplace"></a>

设置 Claude Code 并运行以下命令，将全部 5 个技能作为一个插件安装：

```bash
/plugin marketplace add oxylabs/agent-skills
/plugin install oxylabs@oxylabs-agent-skills
```

要更新技能，请运行此命令：

```bash
/plugin marketplace update oxylabs-agent-skills
```

#### 其他智能体（通用） <a href="#other-agents-generic" id="other-agents-generic"></a>

对于其他智能体和自定义环境，请通过标准 skills CLI 将仓库加载到你的项目工作区：

```bash
npx skills add https://github.com/oxylabs/agent-skills.git
```

#### **手动安装（符号链接）**

要在不使用插件的情况下安装单个技能，请克隆仓库并将该技能链接到你助手的 skills 目录。下面的示例将安装 `代理浏览器` 适用于 Claude Code 的技能：

{% hint style="info" %}
要安装任意技能，请将 `代理浏览器` 替换为上表中的名称。要更新，请运行 `git -C agent-skills pull`.
{% endhint %}

```bash
git clone https://github.com/oxylabs/agent-skills.git
mkdir -p ~/.claude/skills
ln -sfn "$PWD/agent-skills/skills/agent-browser" ~/.claude/skills/agent-browser
```

### 配置

所有技能都通过 `.env` 文件中的环境变量进行身份验证。只添加你使用的产品所需的变量。

<table><thead><tr><th width="167.9296875">变量</th><th width="248">产品</th><th>描述</th></tr></thead><tbody><tr><td><p><code>OXY_RES_USERNAME</code></p><p><code>OXY_RES_PASSWORD</code></p></td><td>住宅和移动代理</td><td>代理用户的用户名和密码</td></tr><tr><td><p><code>OXY_DC_USERNAME</code></p><p><code>OXY_DC_PASSWORD</code></p></td><td>数据中心代理和 ISP代理</td><td>代理用户的用户名和密码</td></tr><tr><td><p><code>OXY_AB_USERNAME</code></p><p><code>OXY_AB_PASSWORD</code></p></td><td>Agent Browser</td><td>Agent Browser 用户的用户名和密码</td></tr><tr><td><p><code>OXYLABS_USERNAME</code></p><p><code>OXYLABS_PASSWORD</code></p></td><td>网页解锁器</td><td>网页解锁器用户的用户名和密码</td></tr><tr><td><code>OXY_HB_ENDPOINT</code></td><td>视频数据（可选）</td><td>用于视频和音频下载的高带宽代理端点</td></tr><tr><td><p><code>OXY_WSA_USERNAME</code></p><p><code>OXY_WSA_PASSWORD</code></p></td><td>视频数据、网页爬虫API</td><td>网页爬虫API用户的用户名和密码</td></tr></tbody></table>

{% hint style="warning" %}
**免责声明：** `OXY_HB_ENDPOINT` 指的是高带宽代理，而不是 Agent Browser。视频数据使用你的网页爬虫API凭据，并且只需要此端点用于媒体下载。
{% endhint %}

### 验证设置

让你的助手用你安装了该技能的产品执行一个小任务。例如，对于 Agent Browser：

{% code overflow="wrap" %}

```
编写并运行一个 TypeScript 的 Playwright 脚本，连接到带有美国地理位置的 Oxylabs Agent Browser，访问 https://ip.oxylabs.io/location，并打印标题和 IP。
```

{% endcode %}

## 使用哪些技能

<table><thead><tr><th width="582.09765625">需要</th><th>使用</th></tr></thead><tbody><tr><td>使用你自己的 HTTP 客户端、代理认证、IP 轮换、粘性会话，或原始的按地理位置定向代理流量</td><td><a href="/products/proxies.md">代理</a></td></tr><tr><td>为你的 AI 代理提供实时网页搜索和页面阅读，这样它就可以研究当前信息并引用其来源</td><td><a href="https://developers.oxylabs.io/products/web-api">Web API</a></td></tr><tr><td>点击、填写表单、截图，或使用 Playwright 或 Puppeteer 自动化</td><td><a href="/products/agent-browser.md">Agent Browser</a></td></tr><tr><td>无需浏览器交互即可抓取受保护页面</td><td><a href="/products/web-unblocker.md">网页解锁器</a></td></tr><tr><td>收集 YouTube 元数据、字幕、搜索结果或频道数据，或下载视频和音频</td><td><a href="https://developers.oxylabs.io/api-targets/video-and-social-media">视频数据</a></td></tr><tr><td>从受支持的目标、搜索结果、电商页面或解析后的 JSON 中获取结构化数据</td><td><a href="/products/web-scraper-api.md">网页爬虫API</a></td></tr></tbody></table>

{% hint style="info" %}
**注意：** 从最适合该任务的最具体产品开始。先测试一个小请求以确认身份验证和输出，然后再扩大规模。
{% endhint %}

如果你在使用 Agent Skills 时需要帮助，请联系我们的 24/7 支持团队获取协助： <support@oxylabs.io>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.oxylabs.io/ai-workflows/cn/dai-li-ji-neng.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
