Skip to content

Commit dd738e3

Browse files
authored
Merge pull request #191 from 0xProject/jlin/add-0x-skills
Add Agent Skills
2 parents e7540cd + 65da5a7 commit dd738e3

File tree

6 files changed

+149
-15
lines changed

6 files changed

+149
-15
lines changed

fern/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ navigation:
8282
- page: Using AI with 0x
8383
slug: using-ai-with-0x
8484
path: docs/pages/introduction/develop-with-ai/using-ai-with-0x.mdx
85+
- page: Agent Skills
86+
slug: agent-skills
87+
path: docs/pages/introduction/develop-with-ai/agent-skills.mdx
8588
- page: MCP
8689
slug: mcp-setup
8790
path: docs/pages/introduction/develop-with-ai/mcp-setup.mdx

fern/docs/pages/0x-swap-api/guides/swap-tokens-with-0x-swap-api-permit2.mdx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you're new to 0x Swap API or want to avoid the double-signature UX, consider
1212

1313
## About Swap API
1414

15-
Swap API is a DEX aggregation and smart order routing REST API that finds the best price for crypto trades. With one API integration, you can easily add trading to your app. Swap API aggregates liquidity from 150+ sources , including AMMs and professional market makers, across the [supported chains](/docs/introduction/supported-chains).
15+
Swap API is a DEX aggregation and smart order routing REST API that finds the best price for crypto trades. With one API integration, you can easily add trading to your app. Swap API aggregates liquidity from 373+ sources, including AMMs and exclusive professional market makers, on 20+ [supported chains](/docs/introduction/supported-chains).
1616

1717
![Swap API UI](../../../assets/img/0x-swap-api/swap-api-ui.png)
1818

@@ -65,6 +65,17 @@ Try this code example directly in your browser—no installation needed!
6565

6666
Every 0x API call requires an API key. [Create a 0x account](https://dashboard.0x.org/) to get your live API key. Follow the [setup guide](/docs/introduction/quickstart/getting-started) for more details.
6767

68+
<Tip>
69+
**Building with an AI coding agent?** Install the 0x Agent Skills to give your agent instant knowledge of the 0x Swap API — swap flows, auth patterns, error handling, and more. Set your API key as an environment variable and your agent handles the rest.
70+
71+
```bash
72+
npx skills add 0xProject/0x-ai
73+
```
74+
75+
[Learn more about 0x Agent Skills](/docs/introduction/develop-with-ai/agent-skills)
76+
77+
</Tip>
78+
6879
## 1. Get an Indicative Price
6980

7081
Let's find the best price!

fern/docs/pages/0x-swap-api/guides/swap-tokens-with-0x-swap-api.mdx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to send your first Swap API (AllowanceHolder) request.
55

66
## About Swap API
77

8-
Swap API is a DEX aggregation and smart order routing REST API that finds the best price for crypto trades. With one API integration, you can easily add trading to your app. Swap API aggregates liquidity from 150+ sources , including AMMs and professional market makers, across the [supported chains](/docs/introduction/supported-chains).
8+
Swap API is a DEX aggregation and smart order routing REST API that finds the best price for crypto trades. With one API integration, you can easily add trading to your app. Swap API aggregates liquidity from 373+ sources, including AMMs and exclusive professional market makers, on 20+ [supported chains](/docs/introduction/supported-chains).
99

1010
![Swap API UI](https://res.cloudinary.com/dr5klrk9c/image/upload/v1761261077/swap-api-ui_q0jiyi.png)
1111

@@ -53,6 +53,17 @@ Try this code example directly in your browser—no installation needed!
5353

5454
Every 0x API call requires an API key. [Create a 0x account](https://dashboard.0x.org/) to get your live API key. Follow the [setup guide](/docs/introduction/quickstart/getting-started) for more details.
5555

56+
<Tip>
57+
**Building with an AI coding agent?** Install the 0x Agent Skills to give your agent instant knowledge of the 0x Swap API — swap flows, auth patterns, error handling, and more. Set your API key as an environment variable and your agent handles the rest.
58+
59+
```bash
60+
npx skills add 0xProject/0x-ai
61+
```
62+
63+
[Learn more about 0x Agent Skills](/docs/introduction/develop-with-ai/agent-skills)
64+
65+
</Tip>
66+
5667
## 1. Get an Indicative Price
5768

5869
Let's find the best price!
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: 0x Agent Skills
3+
description: Give your AI coding agent full knowledge of the 0x APIs with a single command.
4+
---
5+
6+
Give your AI coding agent full knowledge of the 0x APIs with a single command. Once installed, your agent knows every endpoint, authentication method, and integration pattern for token swaps.
7+
8+
Compatible with [Claude Code](https://www.anthropic.com/claude-code), [Cursor](https://cursor.com), [GitHub Copilot](https://code.visualstudio.com/docs/copilot/overview), and any agent that supports the [Agent Skills specification](https://agentskills.io).
9+
10+
## Install
11+
12+
```bash
13+
npx skills add 0xProject/0x-ai
14+
```
15+
16+
| Skill | Auth | Best for |
17+
| -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
18+
| `0x-api` | API key | Token swaps using 0x Swap and Gasless APIs on any [supported EVM chain](https://docs.0x.org/docs/introduction/supported-chains). A [0x API key](https://dashboard.0x.org/create-account) is required. |
19+
20+
## What your agent learns
21+
22+
The `0x-api` skill covers everything needed to build production-ready swap integrations:
23+
24+
- **Swap API v2:** Token swaps across all supported EVM chains. Both AllowanceHolder and Permit2 flows.
25+
- **Gasless API v2:** Swaps with no native token (e.g. ETH) required for gas.
26+
- **Language support:** TypeScript and Python code examples ready to drop into your project.
27+
- **Error handling:** Common failure modes and how to recover from them
28+
- **v1 → v2 migration:** A clear path for upgrading existing 0x integrations
29+
30+
## Getting started
31+
32+
You'll need a [0x API key](https://dashboard.0x.org/create-account) — sign up free at the [0x Dashboard](https://dashboard.0x.org/create-account). Set it as an environment variable and your agent takes it from there.
33+
34+
Once the skill is installed, activate it in any agent session:
35+
36+
```
37+
/0x-api
38+
```
39+
40+
## MCP Server
41+
42+
Alongside the skill, 0x provides an MCP server that gives your agent on-demand access to the latest 0x documentation and API references. This keeps your agent current even when docs have changed since its training cutoff.
43+
44+
The MCP server is set up automatically during `npx skills add`. To configure it manually:
45+
46+
```json
47+
{
48+
"mcpServers": {
49+
"0x-mcp": {
50+
"type": "url",
51+
"url": "https://docs.0x.org/_mcp/server"
52+
}
53+
}
54+
}
55+
```
56+
57+
## Skills vs. MCP — what's the difference?
58+
59+
They solve different problems and work well together:
60+
61+
| | Agent Skills | MCP Server |
62+
| ------------------ | -------------------------------------------------------- | --------------------------------------------------------- |
63+
| **Role** | Embeds API knowledge so the agent can write correct code | Lets the agent fetch live docs and references on demand |
64+
| **Triggered when** | The agent is writing code that calls 0x APIs | The agent needs to verify current endpoints or parameters |
65+
| **Result** | Code that follows 0x patterns and best practices | Up-to-date documentation in the conversation context |
66+
67+
## Next steps
68+
69+
- [GitHub: 0xProject/0x-ai](https://github.com/0xProject/0x-ai)
70+
- [0x Dashboard](https://dashboard.0x.org/create-account)
71+
- [Supported Chains](https://docs.0x.org/docs/introduction/supported-chains)
72+
- [Swap API v2 Reference](https://docs.0x.org/api-reference/api-overview)
73+
- [0x MCP Server](https://docs.0x.org/_mcp/server)

fern/docs/pages/introduction/develop-with-ai/using-ai-with-0x.mdx

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,32 @@ sidebarTitle: "Using AI with 0x"
44
description: Use built-in AI integrations and copy options in 0x Docs to work efficiently with LLMs
55
---
66

7-
0x Docs includes built-in AI integrations and an official MCP server so you can work with up-to-date documentation directly inside your AI tools and editor.
7+
0x Docs includes built-in AI integrations, 0x skills, and an official MCP server so you can work with up-to-date documentation directly inside your AI tools and editor.
88

9-
All options are available from the **page actions menu** on any documentation page.
9+
See the options available from the **page actions menu** on any documentation page.
1010

1111
![context menu in docs](../../../assets/img/introduction/context-menu.png)
1212

1313
## Get started
1414

15-
<CardGroup cols={3}>
15+
<CardGroup cols={2}>
1616

1717
<Card
1818
title="Connect to the 0x MCP Server"
1919
href="/docs/introduction/develop-with-ai/mcp-setup"
2020
icon="plug"
2121
>
2222
Connect AI tools to 0x documentation for an enhanced development experience.
23-
2423
</Card>
2524

26-
{" "}
25+
<Card
26+
title="Install 0x Agent Skills"
27+
href="/docs/introduction/develop-with-ai/agent-skills"
28+
icon="wand-magic-sparkles"
29+
>
30+
Give your AI coding agent instant knowledge of the 0x Swap & Gasless API —
31+
swap flows, auth, error handling, and more with a single command.
32+
</Card>
2733

2834
<Card
2935
title="Use an LLM"
@@ -34,19 +40,36 @@ All options are available from the **page actions menu** on any documentation pa
3440
direct AI tool integrations, and one-click IDE setup.
3541
</Card>
3642

37-
<Card
38-
title="AI Projects with 0x"
39-
href="/docs/introduction/develop-with-ai/ai-tools"
40-
icon="robot"
41-
>
42-
Explore consumer and developer tools using AI and 0x in production.
43-
</Card>
43+
<Card
44+
title="AI Projects with 0x"
45+
href="/docs/introduction/develop-with-ai/ai-tools"
46+
icon="robot"
47+
>
48+
Explore consumer and developer tools using AI and 0x in production.
49+
</Card>
50+
4451
</CardGroup>
4552

4653
## Available Options
4754

4855
Below is a list of all available options, what they do, and when to use them.
4956

57+
### Install Agent Skills
58+
59+
Give your AI coding agent built-in knowledge of the 0x API — no manual prompting or copy-pasting docs required.
60+
61+
```bash
62+
npx skills add 0xProject/0x-ai
63+
```
64+
65+
Once installed, your agent understands the full 0x Swap API surface: swap flows, gasless transactions, authentication, error handling, and chain-specific details. Works with Claude Code, Cursor, GitHub Copilot, and other agents that support the [Agent Skills specification](https://agentskills.io).
66+
67+
→ See the full setup guide: **[0x Agent Skills](/docs/introduction/develop-with-ai/agent-skills)**
68+
69+
Agent Skills are the recommended starting point if you're actively building a swap integration in your editor.
70+
71+
---
72+
5073
### Connect via MCP
5174

5275
For the best AI development experience, connect your editor or AI assistant to the **0x MCP Server**.
@@ -57,6 +80,8 @@ MCP gives AI tools live, searchable access to 0x documentation — no copy-pasti
5780

5881
If you're building in an IDE or working on a multi-step integration, MCP is the recommended approach.
5982

83+
---
84+
6085
### Copy Page
6186

6287
Copies the page in a format optimized for AI tools.

fern/docs/pages/introduction/getting-started.mdx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,19 @@ Additionally, the [0x Help Center](https://help.0x.org/) is a great place to sta
508508
Now that you have a live API key, dive into our building resources and start building!
509509

510510
<CardGroup>
511+
512+
<Card
513+
title="Build with AI"
514+
href="/docs/introduction/develop-with-ai/agent-skills"
515+
icon="wand-magic-sparkles"
516+
>
517+
Accelerate your 0x integration using 0x AI tools - Agent Skills, MCP Server,
518+
and more.
519+
</Card>
520+
511521
<Card title="Swap API" href="/docs/0x-swap-api/introduction" icon="rotate">
512-
Easily add crypto trading with one API, accessing 150+ exchanges and thousands of tokens.
522+
Easily add crypto trading with one API, accessing 150+ exchanges and thousands
523+
of tokens.
513524
</Card>
514525

515526
<Card title="Gasless API" href="/docs/gasless-api/introduction" icon="gas-pump">

0 commit comments

Comments
 (0)