claw-x402

📁 claw-api/clawapiskills 📅 5 days ago
9
总安装量
9
周安装量
#31502
全站排名
安装命令
npx skills add https://github.com/claw-api/clawapiskills --skill claw-x402

Agent 安装分布

gemini-cli 9
github-copilot 9
codex 9
kimi-cli 9
amp 9
cursor 9

Skill 文档

claw-x402 — AI Agent Native API Provider

claw-x402 is an API provider built for the agentic era. No API keys, no signups, no monthly subscriptions. Just pay with USDC per request via the x402 protocol and instantly access Twitter, Instagram, and more.

Traditional API providers: Sign up → Generate API key → Subscribe to a plan → Manage rate limits → Rotate keys

claw-x402: Have a wallet → Call the endpoint → Pay per request. Done.

AI Agents can autonomously discover available endpoints, pay the exact cost per call, and get results — all without human intervention or pre-provisioned credentials.

Available Endpoints

Path Method Price Description
/user GET $0.001 Get Twitter user profile by username
/user-tweets GET $0.001 Get tweets from a Twitter user by ID
/get-users-v2 GET $0.001 Get multiple Twitter users by IDs (comma-separated)
/followings GET $0.001 Get users that a Twitter user is following
/followers GET $0.001 Get followers of a Twitter user
/instagram/posts POST $0.001 Get Instagram posts by username
/instagram/profile POST $0.001 Get Instagram profile by username

Server URL: https://omniapi-production-7de2.up.railway.app

Prerequisites & Setup

1. awal CLI Authentication

The awal CLI (npx awal@latest) handles wallet operations and x402 payments. You must authenticate before making paid API calls.

Check status:

npx awal@latest status

If not authenticated, use the email OTP flow:

# Step 1: Send OTP to your email
npx awal@latest auth login user@example.com
# Output: flowId: abc123...

# Step 2: Verify with the 6-digit code from email
npx awal@latest auth verify abc123 123456

# Confirm authentication
npx awal@latest status

See the authenticate-wallet skill for details.

2. Fund the Wallet

Check your USDC balance:

npx awal@latest balance

If insufficient, fund via Coinbase Onramp:

npx awal@latest show

This opens the wallet companion UI where you can fund with Apple Pay, debit card, bank transfer, or Coinbase account. Alternatively, send USDC on Base directly to your wallet address:

npx awal@latest address

See the fund skill for details.

Summary

Requirement Check Skill
Wallet authenticated npx awal@latest status authenticate-wallet
USDC balance npx awal@latest balance fund

Usage

All requests are made via npx awal@latest x402 pay, which handles USDC payment automatically.

Twitter — Get User Profile

npx awal@latest x402 pay "https://omniapi-production-7de2.up.railway.app/user?username=elonmusk"

Twitter — Get User Tweets

npx awal@latest x402 pay "https://omniapi-production-7de2.up.railway.app/user-tweets?user=44196397&count=20"

The user parameter is the Twitter user ID (numeric). Use the /user endpoint first to get the ID from a username.

Twitter — Get Multiple Users

npx awal@latest x402 pay "https://omniapi-production-7de2.up.railway.app/get-users-v2?users=44196397,50393960"

Accepts comma-separated user IDs.

Twitter — Get Followings

npx awal@latest x402 pay "https://omniapi-production-7de2.up.railway.app/followings?user=44196397&count=20"

Twitter — Get Followers

npx awal@latest x402 pay "https://omniapi-production-7de2.up.railway.app/followers?user=44196397&count=20"

Instagram — Get Posts

npx awal@latest x402 pay "https://omniapi-production-7de2.up.railway.app/instagram/posts" -X POST -d '{"username": "instagram"}'

Instagram — Get Profile

npx awal@latest x402 pay "https://omniapi-production-7de2.up.railway.app/instagram/profile" -X POST -d '{"username": "instagram"}'

Note: Instagram endpoints use POST with a JSON body. Use -X POST -d '{...}' to send the request body.

Response Examples

Twitter User Profile (/user)

{
  "result": {
    "id": "44196397",
    "name": "Elon Musk",
    "screen_name": "elonmusk",
    "description": "...",
    "followers_count": 200000000,
    "friends_count": 800,
    "statuses_count": 50000,
    "profile_image_url_https": "https://pbs.twimg.com/..."
  }
}

Twitter User Tweets (/user-tweets)

{
  "result": {
    "timeline": {
      "instructions": [
        {
          "entries": [
            {
              "content": {
                "tweet_results": {
                  "result": {
                    "legacy": {
                      "full_text": "...",
                      "created_at": "...",
                      "favorite_count": 100,
                      "retweet_count": 50
                    }
                  }
                }
              }
            }
          ]
        }
      ]
    }
  }
}

Instagram Profile (/instagram/profile)

{
  "result": {
    "username": "instagram",
    "full_name": "Instagram",
    "biography": "...",
    "follower_count": 500000000,
    "following_count": 500,
    "media_count": 7000,
    "profile_pic_url": "https://..."
  }
}

Instagram Posts (/instagram/posts)

{
  "result": {
    "items": [
      {
        "caption": { "text": "..." },
        "like_count": 1000000,
        "comment_count": 50000,
        "image_versions": { "items": [{ "url": "https://..." }] },
        "taken_at": 1700000000
      }
    ]
  }
}

Service Catalog

Retrieve the full list of available endpoints and their prices:

curl https://omniapi-production-7de2.up.railway.app/catalog

Returns:

[
  { "path": "/user", "method": "GET", "price": "$0.001", "description": "Get Twitter user profile by username" },
  { "path": "/user-tweets", "method": "GET", "price": "$0.001", "description": "Get tweets from a Twitter user by ID" },
  { "path": "/get-users-v2", "method": "GET", "price": "$0.001", "description": "Get multiple Twitter users by IDs (comma-separated)" },
  { "path": "/followings", "method": "GET", "price": "$0.001", "description": "Get users that a Twitter user is following" },
  { "path": "/followers", "method": "GET", "price": "$0.001", "description": "Get followers of a Twitter user" },
  { "path": "/instagram/posts", "method": "POST", "price": "$0.001", "description": "Get Instagram posts by username" },
  { "path": "/instagram/profile", "method": "POST", "price": "$0.001", "description": "Get Instagram profile by username" }
]

Health Check

curl https://omniapi-production-7de2.up.railway.app/health

Returns: {"status": "ok"}

Troubleshooting

Error Cause Fix
HTTP 402 Payment required Use npx awal@latest x402 pay instead of plain curl to make the request
HTTP 502 Upstream API error The backend service may be temporarily unavailable. Retry after a few seconds
"not signed in" Wallet not authenticated Run npx awal@latest auth login <email> to authenticate. See authenticate-wallet skill
"insufficient balance" Not enough USDC Run npx awal@latest show to fund the wallet. See fund skill
Empty response Invalid parameters Check query parameters — e.g. /user requires ?username=, /user-tweets requires ?user= (numeric ID)
Instagram 400 Missing request body Instagram endpoints require POST with JSON body: -X POST -d '{"username": "..."}'