Back to skills
SkillHub ClubShip Full StackFull StackBackend

x402-creation

Monetize your agent's API or tools using the x402 protocol and USDC micropayments. Enables provisioning, earnings tracking, and withdrawals.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
3,126
Hot score
99
Updated
March 20, 2026
Overall rating
C0.0
Composite score
0.0
Best-practice grade
A88.0

Install command

npx @skill-hub/cli install openclaw-skills-x402-agentic-creation

Repository

openclaw/skills

Skill path: skills/gatex402/x402-agentic-creation

Monetize your agent's API or tools using the x402 protocol and USDC micropayments. Enables provisioning, earnings tracking, and withdrawals.

Open repository

Best for

Primary workflow: Ship Full Stack.

Technical facets: Full Stack, Backend.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: openclaw.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install x402-creation into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/openclaw/skills before adding x402-creation to shared team environments
  • Use x402-creation for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: x402-creation
description: Monetize your agent's API or tools using the x402 protocol and USDC micropayments. Enables provisioning, earnings tracking, and withdrawals.
---

# x402-agentic-creation

**The monetization layer for the Agentic Web.**

Enable your agent to autonomously earn USDC on Base or Solana by monetizing its own API endpoints or services. This skill handles provisioning, earnings tracking, and automated withdrawals via the x402 protocol.

[Official Website](https://gatex402.dev) | [LLM Documentation](https://gatex402.dev/llms-full.txt)

## Platform Data

- **Protocol**: x402 (HTTP 402 Payment Required)
- **Currency**: USDC (Stablecoin)
- **Networks**: Base Mainnet (Ethereum L2), Solana Mainnet
- **Fees**: 1% platform fee (99% provider revenue)
- **Payouts**: Daily automated withdrawals
- **Min Price**: $0.001 per request

## x402 Protocol Flow

1. **Challenge**: Gateway returns HTTP 402 with payment headers.
2. **Transfer**: Agent submits USDC transfer to specified address.
3. **Verification**: Facilitator confirms transaction on-chain.
4. **Dispatch**: Gateway forwards the authorized request to the provider.

## Activation

Add this skill to your agent to allow it to:

- **Provision**: Register a new API gateway instance on GateX402.
- **Monetize**: Set USDC pricing per request for its tools/endpoints.
- **Withdraw**: Transfer USDC earnings to its wallet.

## Tools

### `provision_api`

Use this tool to register a new API on the GateX402 gateway.

- **Required Inputs**:
  - `api_name` — Human-readable name for the API.
  - `network` — CAIP-2 network ID (e.g. `eip155:8453` for Base Mainnet, `solana:5eykt4UsFv8P8NJdTREpY1vzqAQZSSfL` for Solana Mainnet).
  - `origin_url` — **Your API’s base URL** (the backend you are monetizing), e.g. `https://your-api.example.com`. Do not use the gateway URL (`api.gatex402.dev`).
  - `routes` — Array of `{ path_pattern, method, price_usdc }` (e.g. `path_pattern: "/v1/chat"`, `method: "POST"`, `price_usdc: 0.01`).
- **Outcome**: Returns only `api_slug`, `provider_id`, and a short message in a boundary-wrapped response. The management token is stored by the runtime via `storeManagementToken` and is never returned to the agent.

### `get_earnings`

Retrieve real-time balance of earned USDC split by network.

- **Inputs**: None (uses management token from host).
- **Outcome**: Sanitized balance data wrapped in `<!-- GATEX402_API_RESPONSE -->` boundaries.

### `withdraw_funds`

Trigger a payout to your registered wallet.

- **Required Inputs**: `network` (e.g. `eip155:8453` for Base Mainnet, `solana:5eykt4UsFv8P8NJdTREpY1vzqAQZSSfL` for Solana Mainnet).
- **Outcome**: Sanitized status/tx data wrapped in response boundaries.

## Guardrails

- **Management Token**: The runtime stores the `gx4_mgmt_...` token via `storeManagementToken`; it is never returned to the agent.
- **Credentials**: Wallet private key and management token are injected by the host via `createTools` only; they must never appear in tool parameters.

## Resources

- **Backend**: https://api.gatex402.dev (all provisioning, balance, and withdrawal requests)
- **OpenAPI spec**: https://api.gatex402.dev/openapi.json
- **Homepage**: https://gatex402.dev
- **Bazaar Discovery**: https://gatex402.dev/discover
- **AI Plugin**: https://api.gatex402.dev/.well-known/ai-plugin.json


---

## Skill Companion Files

> Additional files collected from the skill directory layout.

### README.md

```markdown
# x402-creation

**The monetization layer for the Agentic Web.**

GateX402 is an API monetization platform. This repository provides a production-ready **Agent Skill** that enables AI agents to autonomously earn USDC by monetizing their own API endpoints or services.

## Features

- **Self-Provisioning**: Automated API gateway setup via wallet-signed handshakes.
- **Earnings Management**: Real-time USDC balance tracking and gas-estimated withdrawals.
- **Ecosystem Ready**: First-class support for Coinbase Agentic Wallet and the `awal` CLI.
- **Protocol Native**: Built on the x402 HTTP challenge-response standard.

## Installation

**Recommended (npm + official repo):** Install from npm and add the skill from this repository or the installed package. No third-party registry required.

```bash
npm install x402-creation
```

To add this skill in an agent framework, point it at the installed package or at the official repo (e.g. `https://github.com/gatex402/monetize-agent-skills` or the path to this package). Do not pass wallet keys or management tokens in tool parameters—use `createTools` with credential injectors (see below).

**Alternative (third-party registry):** If your environment allows it, you can also add via a compatible registry:

```bash
npx skills add gatex402/monetize-agent-skills --skill x402-creation
```

Prefer the npm + official repo flow when possible for safer, auditable installation.

## Quick Start (TypeScript)

Credentials are injected by the host via `createTools`. The agent never receives wallet private keys or management tokens.

```typescript
import { createTools } from "x402-creation";

let managementToken: string | null = null;

const tools = createTools({
  getWalletPrivateKey: async () => process.env.AGENT_PRIVATE_KEY!,
  getManagementToken: async () => managementToken ?? "",
  storeManagementToken: (token) => {
    managementToken = token;
  },
});

// 1. Provision a new API (token is stored by storeManagementToken, not returned to agent)
// origin_url must be YOUR API's base URL (the backend you monetize), not api.gatex402.dev
const provisionResult = await tools.provision_api({
  api_name: "My Agent API",
  network: "eip155:8453",
  origin_url: "https://your-api.example.com",
  routes: [{ path_pattern: "/v1/chat", method: "POST", price_usdc: 0.01 }],
});
// provisionResult is agent-safe (api_slug, provider_id, message); no raw token.

// 2. Check earnings & withdraw
const balance = await tools.get_earnings();
const tx = await tools.withdraw_funds({ network: "eip155:8453" });
```

## Supported networks

- **Base Mainnet**: `eip155:8453`
- **Solana Mainnet**: `solana:5eykt4UsFv8P8NJdTREpY1vzqAQZSSfL`

## Tools Definition

- `provision_api`: Registers a new API gateway instance on GateX402. Requires `api_name`, `network` (e.g. `eip155:8453` for Base Mainnet, `solana:5eykt4UsFv8P8NJdTREpY1vzqAQZSSfL` for Solana Mainnet), `origin_url` (your API’s base URL—the backend you monetize, not the gateway), and `routes` (array of `{ path_pattern, method, price_usdc }`). Management token is passed to `storeManagementToken` and never returned to the agent.
- `get_earnings`: Returns current USDC balance (sanitized). No parameters.
- `withdraw_funds`: Triggers a payout. Requires `network` (e.g. `eip155:8453` for Base Mainnet, `solana:5eykt4UsFv8P8NJdTREpY1vzqAQZSSfL` for Solana Mainnet).

## Security Guardrails

- **Token Isolation**: Management tokens (`gx4_mgmt_...`) are never returned to the agent. The host stores them via `storeManagementToken` and supplies them via `getManagementToken`.
- **Credential Injection**: Wallet private key and management token are provided only by the host through `createTools`; they must never appear in tool parameters visible to the agent.
- **Spending Limits**: We recommend using Coinbase Agentic Wallet session-level controls.

See [SECURITY.md](SECURITY.md) for backend communication and trust boundaries.

## Links

- [GateX402 Homepage](https://gatex402.dev)
- [Bazaar Discovery Marketplace](https://gatex402.dev/discover)
- [Full Documentation (LLM Optimized)](https://gatex402.dev/llms-full.txt)

## License

MIT

```

### _meta.json

```json
{
  "owner": "gatex402",
  "slug": "x402-agentic-creation",
  "displayName": "x402 Agentic Creation",
  "latest": {
    "version": "1.0.0",
    "publishedAt": 1772010093634,
    "commit": "https://github.com/openclaw/skills/commit/07eca2660ff1d5785745ddb8214b4f656e33c68e"
  },
  "history": []
}

```

### references/safety.md

```markdown
# Safety Guardrails for GateX402 Skill

When using the GateX402 Agent Skill, agents must adhere to the following safety protocols:

1. **Private Key Isolation**: The host injects the wallet private key via `createTools({ getWalletPrivateKey })` from secure storage (e.g. env or vault). Never pass it in tool parameters visible to the agent.
2. **Management Token Privacy**: The runtime stores the management token via `storeManagementToken` and supplies it via `getManagementToken`. The token is never returned to the agent.
3. **Withdrawal Limits**: Automated withdrawals should be subject to session limits. We recommend using the **Coinbase Agentic Wallet** to enforce spending and transaction limits at the wallet level.
4. **Network Verification**: Double-check the network ID (e.g. `eip155:8453` for Base Mainnet, `solana:5eykt4UsFv8P8NJdTREpY1vzqAQZSSfL` for Solana Mainnet) before executing withdrawals to avoid gas loss or stuck transactions.

```

x402-creation | SkillHub