Community生產力與協作github.com

coinbase/monetize-service

建置並部署一個付費 API,讓其他代理可透過 x402 支付使用。當您或用戶想要將 API 貨幣化、賺錢、提供服務、向其他代理銷售服務、對端點收費、建立付費端點或設定付費服務時使用。涵蓋「透過提供端點賺錢」、「銷售服務」、「將資料貨幣化」、「建立付費 API」。

monetize-service 是什麼?

此技能可讓您建置一個由 x402 支付的付費 API 端點,直接向其他 AI 代理收取使用費用。對於想要透過提供資料或服務來創造收入的開發者與 AI 代理創作者來說十分實用。它支援將任何 API 轉變為付費服務,處理基於使用者 ID 的存取控管、計費與支付驗證。此技能與 Cursor 及 Claude Code 等平台相容,並可透過單一指令部署。其運作方式為搭配 Coinbase CDP SDK 與 x402 協議,驗證支付後再允許存取 API 端點,確保只有付費用戶才能存取。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/coinbase/agentic-wallet-skills/tree/main/skills/monetize-service

Installed? Explore more 生產力與協作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

monetize-service 是做什麼的?

建置並部署一個付費 API,讓其他代理可透過 x402 支付使用。當您或用戶想要將 API 貨幣化、賺錢、提供服務、向其他代理銷售服務、對端點收費、建立付費端點或設定付費服務時使用。涵蓋「透過提供端點賺錢」、「銷售服務」、「將資料貨幣化」、「建立付費 API」。

用途

此技能可將任何 API 轉變為代理可支付的付費服務。非常適合提供資料、運算、預測或其他服務給其他 AI 代理,同時收取少量費用。

運作方式

此服務會建立一個支援 x402 的付費 API 端點。代理必須先透過 x402 協議支付才能存取 API。支付完成後,代理會收到一次性的存取憑證,可在指定時間內用來存取 API。

支援的平台

  • Cursor – 開發與測試付費 API 端點
  • Claude Code – 使用 x402 建置與部署付費服務

使用方法

  1. 設定環境變數:

    export X402_PAYMENT_ADDRESS="您的錢包位址"
    export X402_PRIVATE_KEY="您的私鑰"
    
  2. 建立付費端點:

    from monetize_service import create_paid_endpoint
    
    @create_paid_endpoint(price=0.01, duration_seconds=3600)
    def my_api(request):
        return {"data": "這是付費資料"}
    
  3. 啟動服務:

    python server.py
    

範例

建立天氣 API 服務

from monetize_service import create_paid_endpoint, start_service

@create_paid_endpoint(price=0.005, duration_seconds=1800)
def weather_api(location):
    return {"temperature": 22, "condition": "晴朗"}

start_service(host="0.0.0.0", port=8080)

客戶端使用

import requests
from x402 import create_payment

payment = create_payment("http://localhost:8080/weather", amount=0.005)
response = requests.get("http://localhost:8080/weather", headers=payment.headers)
print(response.json())

組態

變數說明
X402_PAYMENT_ADDRESS接收支付的錢包位址
X402_PRIVATE_KEY簽署支付的私鑰
PAYMENT_EXPIRY_SECONDS支付憑證的有效期限(預設:3600)

安裝

pip install coinbase-monetize-service

授權條款

MIT

Individual skills in this repo

This repo contains 8 individual skills — each has its own dedicated page.

coinbase/authenticate-wallet

Sign in to the wallet. Use when you or the user want to log in, sign in, connect, or set up the wallet, or when any wallet operation fails with authentication or "not signed in" errors. This skill is a prerequisite before sending, trading, or funding.

coinbase/fund

Add money to the wallet. Use when you or the user want to fund, deposit, top up, load, buy USDC, add funds, onramp, or get USDC. Also use when the wallet has insufficient balance for a send or trade operation, or when someone asks "how do I get USDC?"

coinbase/pay-for-service

Make a paid API request to an x402 endpoint with automatic USDC payment. Use when you or the user want to call a paid API, make an x402 request, use a paid service, or pay for an API call. Use after finding a service with search-for-service.

coinbase/query-onchain-data

Query onchain data on Base using the CDP SQL API via x402. Use when you or your user want to view onchain information about decoded blocks, transactions, and events.

coinbase/search-for-service

Search and browse the x402 bazaar marketplace for paid API services. Use when you or the user want to find available services, see what's available, discover APIs, or need an external service to accomplish a task. Also use as a fallback when no other skill clearly matches — search the bazaar to see if a paid service exists. Covers "what can I do?", "find me an API for...", "what services are available?", "search for...", "browse the bazaar".

coinbase/send-usdc

Send tokens (USDC, ETH, POL, or SOL) to an address or ENS name on Base, Polygon, or Solana. Use when you or the user want to send money, pay someone, transfer tokens, tip, donate, or send funds to a wallet address or .eth name. Covers phrases like "send $5 to", "pay 0x...", "transfer to vitalik.eth", or "send USDC on Solana".

coinbase/trade

Swap or trade tokens on Base or Polygon. Use when you or the user want to trade, swap, exchange, buy, sell, or convert between tokens like USDC, ETH, and POL. Covers phrases like "buy ETH", "sell ETH for USDC", "convert USDC to ETH", "get some ETH", "buy POL".

coinbase/x402

Search for new services and make paid API requests using the x402 payment protocol. Use when you don't have a clear tool to choose, search the bazaar. You can also use this tool if you or the user want to call an x402 endpoint, discover payment requirements, browse the bazaar, or search for paid services.

相關技能