Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ navigation:
- page: Using AI with 0x
slug: using-ai-with-0x
path: docs/pages/introduction/develop-with-ai/using-ai-with-0x.mdx
- page: Agent Skills
slug: agent-skills
path: docs/pages/introduction/develop-with-ai/agent-skills.mdx
- page: MCP
slug: mcp-setup
path: docs/pages/introduction/develop-with-ai/mcp-setup.mdx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you're new to 0x Swap API or want to avoid the double-signature UX, consider

## About Swap API

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

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

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

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.

<Tip>
**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.

```bash
npx skills add 0xProject/0x-ai
```

→ [Learn more about 0x Agent Skills](/docs/introduction/develop-with-ai/agent-skills)

</Tip>

## 1. Get an Indicative Price

Let's find the best price!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Learn how to send your first Swap API (AllowanceHolder) request.

## About Swap API

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

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

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

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.

<Tip>
**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.

```bash
npx skills add 0xProject/0x-ai
```

→ [Learn more about 0x Agent Skills](/docs/introduction/develop-with-ai/agent-skills)

</Tip>

## 1. Get an Indicative Price

Let's find the best price!
Expand Down
73 changes: 73 additions & 0 deletions fern/docs/pages/introduction/develop-with-ai/agent-skills.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: 0x Agent Skills
description: Give your AI coding agent full knowledge of the 0x APIs with a single command.
---

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.

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

## Install

```bash
npx skills add 0xProject/0x-ai
```

| Skill | Auth | Best for |
| -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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. |

## What your agent learns

The `0x-api` skill covers everything needed to build production-ready swap integrations:

- **Swap API v2:** Token swaps across all supported EVM chains. Both AllowanceHolder and Permit2 flows.
- **Gasless API v2:** Swaps with no native token (e.g. ETH) required for gas.
- **Language support:** TypeScript and Python code examples ready to drop into your project.
- **Error handling:** Common failure modes and how to recover from them
- **v1 → v2 migration:** A clear path for upgrading existing 0x integrations

## Getting started

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.

Once the skill is installed, activate it in any agent session:

```
/0x-api
```

## MCP Server

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.

The MCP server is set up automatically during `npx skills add`. To configure it manually:

```json
{
"mcpServers": {
"0x-mcp": {
"type": "url",
"url": "https://docs.0x.org/_mcp/server"
}
}
}
```

## Skills vs. MCP — what's the difference?

They solve different problems and work well together:

| | Agent Skills | MCP Server |
| ------------------ | -------------------------------------------------------- | --------------------------------------------------------- |
| **Role** | Embeds API knowledge so the agent can write correct code | Lets the agent fetch live docs and references on demand |
| **Triggered when** | The agent is writing code that calls 0x APIs | The agent needs to verify current endpoints or parameters |
| **Result** | Code that follows 0x patterns and best practices | Up-to-date documentation in the conversation context |

## Next steps

- [GitHub: 0xProject/0x-ai](https://github.com/0xProject/0x-ai)
- [0x Dashboard](https://dashboard.0x.org/create-account)
- [Supported Chains](https://docs.0x.org/docs/introduction/supported-chains)
- [Swap API v2 Reference](https://docs.0x.org/api-reference/api-overview)
- [0x MCP Server](https://docs.0x.org/_mcp/server)
49 changes: 37 additions & 12 deletions fern/docs/pages/introduction/develop-with-ai/using-ai-with-0x.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,32 @@ sidebarTitle: "Using AI with 0x"
description: Use built-in AI integrations and copy options in 0x Docs to work efficiently with LLMs
---

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

All options are available from the **page actions menu** on any documentation page.
See the options available from the **page actions menu** on any documentation page.

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

## Get started

<CardGroup cols={3}>
<CardGroup cols={2}>

<Card
title="Connect to the 0x MCP Server"
href="/docs/introduction/develop-with-ai/mcp-setup"
icon="plug"
>
Connect AI tools to 0x documentation for an enhanced development experience.

</Card>

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

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

<Card
title="AI Projects with 0x"
href="/docs/introduction/develop-with-ai/ai-tools"
icon="robot"
>
Explore consumer and developer tools using AI and 0x in production.
</Card>
<Card
title="AI Projects with 0x"
href="/docs/introduction/develop-with-ai/ai-tools"
icon="robot"
>
Explore consumer and developer tools using AI and 0x in production.
</Card>

</CardGroup>

## Available Options

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

### Install Agent Skills

Give your AI coding agent built-in knowledge of the 0x API — no manual prompting or copy-pasting docs required.

```bash
npx skills add 0xProject/0x-ai
```

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

→ See the full setup guide: **[0x Agent Skills](/docs/introduction/develop-with-ai/agent-skills)**

Agent Skills are the recommended starting point if you're actively building a swap integration in your editor.

---

### Connect via MCP

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

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

---

### Copy Page

Copies the page in a format optimized for AI tools.
Expand Down
13 changes: 12 additions & 1 deletion fern/docs/pages/introduction/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,19 @@ Additionally, the [0x Help Center](https://help.0x.org/) is a great place to sta
Now that you have a live API key, dive into our building resources and start building!

<CardGroup>

<Card
title="Build with AI"
href="/docs/introduction/develop-with-ai/agent-skills"
icon="wand-magic-sparkles"
>
Accelerate your 0x integration using 0x AI tools - Agent Skills, MCP Server,
and more.
</Card>

<Card title="Swap API" href="/docs/0x-swap-api/introduction" icon="rotate">
Easily add crypto trading with one API, accessing 150+ exchanges and thousands of tokens.
Easily add crypto trading with one API, accessing 150+ exchanges and thousands
of tokens.
</Card>

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