Serving Skills
Configure and run your skill server with the serve() function.
Serving Skills
The serve() function starts an HTTP server with x402 payment protection.
Basic Usage
Run your server:
Serve Options
Port Configuration
Wallet Configuration
The wallet address is used for receiving payments. You can pass:
- A 42-character address:
0x4554A88d9e4D1bef5338F65A3Cd335C6A27E5368 - A 66-character private key (address is derived):
0x1234...
Note: Private keys are no longer required for serving skills. The SDK only needs your wallet address to receive payments.
API Key Configuration
API keys authenticate registration requests:
Get an API key from skillz.market/dashboard.
Network Configuration
Default is Base mainnet (eip155:8453):
Callbacks
onCall
Called when a skill is invoked:
onError
Called when a skill throws an error:
Server Endpoints
When you serve skills, these endpoints are available:
| Endpoint | Method | Description |
|---|---|---|
/health | GET | Health check (returns skill names) |
/[skillName] | POST | Call a skill |
Health Check
Skill Endpoints
Each skill is available at POST /[skillName]:
Without payment, you'll get a 402 Payment Required response with x402 details.
Response Format
Skill responses follow this format:
Analytics Tracking
By default, skill calls are tracked for analytics:
Auto-Registration
Enable automatic registration with the marketplace:
See Registration for details.
Example: Production Setup
Environment Variables
| Variable | Description |
|---|---|
SKILLZ_API_KEY | API key for registration |
SKILLZ_WALLET_ADDRESS | Wallet address for receiving payments |
SKILLZ_WALLET_KEY | Private key (legacy, address is derived) |
Next Steps
- Registration - Register for marketplace discovery
- x402 Payments - Understand the payment flow