openkrillEnable AI agents to make micropayments via x402 protocol. Use when purchasing browser sessions on Browserbase, scraping with Firecrawl, or any x402-compatible API. Handles wallet creation, funding, and automatic payment flows.
Install via ClawdBot CLI:
clawdbot install emilankerwiik/openkrillThis skill enables AI agents to autonomously make micropayments using the x402 protocol. It handles wallet management, balance checking, and automatic payment flows when APIs return HTTP 402 Payment Required responses.
TIP: When a user or agent asks what services are available for purchase, always start by querying the Bazaar discovery endpoint. It provides a live, up-to-date catalog of 12,000+ x402-compatible services.
# Query the Bazaar to see what's available (no auth required)
curl -s "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources?type=http&limit=50"
Before using this skill, ensure:
| Type | Description | Example |
|------|-------------|---------|
| True x402 | Fully keyless - no API keys needed, just pay and use | Browserbase |
| Hybrid x402 | Requires API key/token + payment header | Firecrawl |
| Service | Standard API | x402 Endpoint | Type | Status |
|---------|-------------|---------------|------|--------|
| Browserbase | api.browserbase.com | x402.browserbase.com | True x402 | β
Works |
| Firecrawl | api.firecrawl.dev/v1/search | api.firecrawl.dev/v1/x402/search | Non-standard | β Broken |
Discovery tips:
x402. subdomain (e.g., x402.browserbase.com)/x402/ in the path (e.g., /v1/x402/search)curl https://x402.browserbase.com/)Use the thirdweb API directly (recommended):
curl -s -X POST https://api.thirdweb.com/v1/wallets/server \
-H "Content-Type: application/json" \
-H "x-secret-key: $THIRDWEB_SECRET_KEY" \
-d '{"identifier": "x402-agent-wallet"}'
The response will include the wallet address. Store this for subsequent operations.
Call the thirdweb x402 fetch API directly:
# Browserbase - Create browser session
curl -s -X POST "https://api.thirdweb.com/v1/payments/x402/fetch?url=https://x402.browserbase.com/browser/session/create&method=POST" \
-H "Content-Type: application/json" \
-H "x-secret-key: $THIRDWEB_SECRET_KEY" \
-d '{"browserSettings": {"viewport": {"width": 1920, "height": 1080}}}'
Success: The API returns the session data directly.
Insufficient Funds: If the wallet needs funding, the API returns:
{
"result": {
"message": "This endpoint requires 0.002 USDC on chain id 8453...",
"link": "https://thirdweb.com/pay?chain=8453&receiver=0x...&token=0x..."
}
}
When you receive a payment link, open it in the user's browser:
This opens thirdweb's payment page where users can fund the wallet.
URL: https://api.thirdweb.com/v1/payments/x402/fetch
Method: POST
Query Parameters:
| Parameter | Required | Description |
|-----------|----------|-------------|
| url | Yes | Target API URL to call |
| method | Yes | HTTP method (GET, POST, etc.) |
| from | No | Wallet address for payment (uses default project wallet if omitted) |
| maxValue | No | Maximum payment amount in wei |
| asset | No | Payment token address (defaults to USDC) |
| chainId | No | Chain ID for payment (e.g., "eip155:8453" for Base) |
Headers:
x-secret-key: Your thirdweb project secret key (required)Content-Type: application/jsonx402 Endpoint: https://x402.browserbase.com
Pricing: $0.12/hour (paid in USDC on Base)
| Endpoint | Method | Description |
|----------|--------|-------------|
| /browser/session/create | POST | Create a browser session |
| /browser/session/:id/status | GET | Check session status |
| /browser/session/:id/extend | POST | Add more time |
| /browser/session/:id | DELETE | Terminate session |
curl -s -X POST "https://api.thirdweb.com/v1/payments/x402/fetch?url=https://x402.browserbase.com/browser/session/create&method=POST" \
-H "Content-Type: application/json" \
-H "x-secret-key: $THIRDWEB_SECRET_KEY" \
-d '{"browserSettings": {"viewport": {"width": 1920, "height": 1080}}}'
x402 Endpoint: https://api.firecrawl.dev/v1/x402/search
Pricing: $0.01/request
Status: β οΈ Incomplete implementation - cannot be used with thirdweb
WARNING: Firecrawl's x402 implementation is non-standard and currently unusable for automated agents:
1. Returns401 Unauthorizedinstead of402 Payment Required
2. Doesn't include payment details (payTo address, asset, amount) in response
3. Documentation says to use X-Payment: {{paymentHeader}} but doesn't explain how to generate it
Comparison with proper x402 (Browserbase):
- Browserbase: Returns 402 withx402Version,accepts,payTo,assetβ thirdweb can auto-pay
- Firecrawl: Returns 401 with just {"error":"Unauthorized"} β no payment info provided
| Endpoint | Method | Status |
|----------|--------|--------|
| /v1/x402/search | POST | β Non-functional for agents |
Recommended alternatives:
Reference: Firecrawl x402 docs
Base URL: https://api.mail.tm
Pricing: Free (no x402 payment required)
Mail.tm allows agents to create email addresses for signups and receive verification emails.
| Endpoint | Method | Auth | Description |
|----------|--------|------|-------------|
| /domains | GET | No | Get available email domains |
| /accounts | POST | No | Create an email account |
| /token | POST | No | Get authentication token |
| /messages | GET | Yes | List all messages |
| /messages/:id | GET | Yes | Get full message content |
| /me | GET | Yes | Get account info |
# 1. Get available domain
DOMAIN=$(curl -s https://api.mail.tm/domains | jq -r '.["hydra:member"][0].domain')
# 2. Create account with unique address
curl -s -X POST https://api.mail.tm/accounts \
-H "Content-Type: application/json" \
-d '{"address": "agent-'$(date +%s)'@'"$DOMAIN"'", "password": "SecurePass123!"}'
# Get auth token
TOKEN=$(curl -s -X POST https://api.mail.tm/token \
-H "Content-Type: application/json" \
-d '{"address": "YOUR_EMAIL", "password": "YOUR_PASSWORD"}' | jq -r '.token')
# List messages
curl -s https://api.mail.tm/messages -H "Authorization: Bearer $TOKEN"
# Read specific message
curl -s https://api.mail.tm/messages/MESSAGE_ID -H "Authorization: Bearer $TOKEN"
Important: Store email credentials (address, password, token) for later use. Consider saving to .agent-emails.json (gitignored).
| Error | Cause | Solution |
|-------|-------|----------|
| 401 Unauthorized | Invalid or missing THIRDWEB_SECRET_KEY | Check environment variable |
| 402 Payment Required | Insufficient balance | Auto-open payment link (see above) |
| 400 Bad Request | Invalid URL or method | Verify request parameters |
| 404 Not Found | Wrong endpoint | Check x402-specific endpoint (e.g., x402.browserbase.com) |
| 500 Server Error | thirdweb or target API issue | Retry or check service status |
api.browserbase.com vs x402.browserbase.com/v1/sessions vs /browser/session/createlink fieldThere are two ways to discover x402-compatible services:
The x402 Bazaar is a machine-readable catalog that helps AI agents discover x402-compatible API endpoints programmatically.
# Using the default facilitator (x402.org)
curl -s "https://x402.org/facilitator/discovery/resources?type=http&limit=20"
# Using CDP facilitator (Coinbase)
curl -s "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources?type=http&limit=20"
# Discover available services
npx ts-node scripts/discover-services.ts
# With pagination
npx ts-node scripts/discover-services.ts --limit 50 --offset 0
# Use CDP facilitator
npx ts-node scripts/discover-services.ts --facilitator "https://api.cdp.coinbase.com/platform/v2/x402"
# Output as JSON for programmatic use
npx ts-node scripts/discover-services.ts --json
{
"x402Version": 2,
"items": [
{
"resource": "https://x402.browserbase.com/browser/session/create",
"type": "http",
"x402Version": 1,
"accepts": [
{
"scheme": "exact",
"network": "eip155:8453",
"amount": "2000",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"payTo": "0x..."
}
],
"lastUpdated": "2024-01-15T12:30:00.000Z",
"metadata": {
"description": "Create a browser session",
"input": { ... },
"output": { ... }
}
}
],
"pagination": {
"limit": 20,
"offset": 0,
"total": 42
}
}
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| type | string | - | Filter by protocol type (e.g., "http") |
| limit | number | 20 | Number of resources to return (max: 100) |
| offset | number | 0 | Offset for pagination |
When encountering a new service that might support x402:
# Try the x402 subdomain - often has an info page
curl -s https://x402.SERVICE.com/
# Example: Browserbase lists all endpoints at root
curl -s https://x402.browserbase.com/
# Some services use path prefix instead of subdomain
curl -s -I https://api.SERVICE.com/v1/x402/endpoint
# A true x402 endpoint returns 402 Payment Required (not 401)
curl -s -i -X POST https://x402.SERVICE.com/endpoint \
-H "Content-Type: application/json" \
-d '{}' 2>&1 | head -5
Expected for true x402:
HTTP/2 402
x-payment-required: ...
If you see 401 Unauthorized: The service uses hybrid x402 (needs API key + payment).
Look for x402/payments documentation:
docs.SERVICE.com/x402/docs.SERVICE.com/payments/AI Usage Analysis
Analysis is being generated⦠refresh in a few seconds.
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Search and analyze your own session logs (older/parent conversations) using jq.
Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", entity CRUD, or cross-skill data access.
Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.
Headless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection