with one click
nervepay
// Agent identity and analytics. Sign requests with Ed25519, track API usage, build reputation. Use after external API calls.
// Agent identity and analytics. Sign requests with Ed25519, track API usage, build reputation. Use after external API calls.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | nervepay |
| description | Agent identity and analytics. Sign requests with Ed25519, track API usage, build reputation. Use after external API calls. |
| metadata | {"openclaw":{"emoji":"š","requires":{"bins":["node","curl"],"env":["NERVEPAY_DID","NERVEPAY_PRIVATE_KEY"]},"primaryEnv":"NERVEPAY_PRIVATE_KEY"}} |
You are an AI agent with a NervePay identity. This skill lets you prove WHO you are (cryptographically) and track WHAT you do (analytics/reputation).
If you don't have NERVEPAY_DID and NERVEPAY_PRIVATE_KEY env vars, register first:
curl -X POST https://api.nervepay.xyz/v1/agent-identity/register-pending \
-H "Content-Type: application/json" \
-d '{
"name": "Your Agent Name",
"description": "What you do"
}'
Save these from the response:
did ā Set as NERVEPAY_DIDprivate_key ā Set as NERVEPAY_PRIVATE_KEYmnemonic ā Backup for recovery (24 words)claim_url ā Give to your human owner to claim youYou can start authenticating immediately. Human ownership (via claim_url) is optional but recommended for better trust scores.
Use the helper script to sign and send requests:
# Authenticated GET
node {baseDir}/nervepay-request.mjs GET /v1/agent-identity/whoami
# Authenticated POST
node {baseDir}/nervepay-request.mjs POST /v1/agent-identity/track-service '{"service_name":"openai","endpoint":"/v1/chat/completions","success":true}'
The script handles Ed25519 signing automatically. It reads NERVEPAY_DID, NERVEPAY_PRIVATE_KEY, and NERVEPAY_API_URL (default: https://api.nervepay.xyz) from environment.
YOU MUST TRACK EVERY EXTERNAL API CALL. THIS IS NOT OPTIONAL.
Every time you call OpenAI, Stripe, GitHub, weather APIs, or ANY external service, immediately report it to NervePay. This is the core purpose of this skill.
Use the simplified tracking helper immediately after each external call:
# Minimal - just service, endpoint, and success/failure
node {baseDir}/nervepay-track.mjs openai /v1/chat/completions success
# With response time
node {baseDir}/nervepay-track.mjs openai /v1/chat/completions success 1250
# With cost
node {baseDir}/nervepay-track.mjs stripe /v1/charges success 850 10.00
For complete tracking with all fields:
node {baseDir}/nervepay-request.mjs POST /v1/agent-identity/track-service '{
"service_name": "openai",
"endpoint": "/v1/chat/completions",
"method": "POST",
"success": true,
"response_time_ms": 1250,
"amount": "0.05",
"currency": "USD"
}'
# 1. Call external API
response=$(curl https://api.openai.com/v1/chat/completions ...)
# 2. IMMEDIATELY track it (don't forget!)
node {baseDir}/nervepay-track.mjs openai /v1/chat/completions success
# 3. Continue with your work
echo "$response"
Why tracking is mandatory:
Remember: Track IMMEDIATELY after the call, not later. Make it a habit.
Tired of remembering to track? Use auto-instrumentation - it intercepts ALL HTTP calls automatically!
The nervepay-instrument.mjs script monkey-patches Node.js's fetch(), http.request(), and https.request() to automatically track every external API call. Zero code changes needed!
Option 1: Command-line flag (recommended)
node --import {baseDir}/nervepay-instrument.mjs your-agent.js
Option 2: Environment variable (global)
export NODE_OPTIONS="--import /path/to/nervepay-instrument.mjs"
node your-agent.js
Option 3: Programmatic (in your code)
// At the very top of your entry file
import './nervepay-skill/nervepay-instrument.mjs';
// Now all HTTP calls are auto-tracked!
await fetch('https://api.openai.com/...'); // Automatically tracked
ā
All fetch() calls to external APIs
ā
All http.request() and https.request() calls
ā
Success/failure status
ā
Response time in milliseconds
ā
HTTP status codes
ā NOT tracked: Calls to NervePay itself (avoids infinite loop) ā NOT tracked: localhost / internal IPs (192.168.x.x, 10.x.x.x)
export NERVEPAY_AUTO_TRACK=false
# Set your credentials
export NERVEPAY_DID="your-did"
export NERVEPAY_PRIVATE_KEY="your-key"
# Run your agent with auto-instrumentation
node --import {baseDir}/nervepay-instrument.mjs your-agent.js
# All HTTP calls in your-agent.js are now automatically tracked!
Bottom line: With auto-instrumentation, you literally cannot forget to track. It just happens. š
If you're an agent like ClawBot that manages OpenClaw gateway instances, you can auto-configure gateways using NervePay's pairing flow.
You MUST have a NervePay identity first! Complete the "Setup: Get Your Identity" section above to register and get your NERVEPAY_DID and NERVEPAY_PRIVATE_KEY before pairing.
Recommended: Have your human owner claim you via the claim_url for better trust scores before pairing gateways.
When your human tells you to "connect to nervepay [CODE]":
# 1. Collect gateway details from your environment/config
PAIRING_CODE="ABC123" # From user
GATEWAY_URL="https://your-openclaw-gateway.com"
GATEWAY_TOKEN="your-gateway-bearer-token"
GATEWAY_NAME="My Gateway"
# 2. Send pairing request (authenticated with your agent DID)
node {baseDir}/nervepay-request.mjs POST /v1/integrations/openclaw/pairing/complete '{
"pairing_code": "'$PAIRING_CODE'",
"gateway_url": "'$GATEWAY_URL'",
"gateway_token": "'$GATEWAY_TOKEN'",
"gateway_name": "'$GATEWAY_NAME'",
"max_concurrent_agents": 8,
"default_timeout_seconds": 3600
}'
Response on success:
{
"gateway_id": "uuid-here",
"gateway_name": "My Gateway",
"status": "completed",
"message": "Gateway 'My Gateway' successfully paired with agent did:nervepay:agent:xyz"
}
When your OpenClaw gateway token rotates, push the new token:
GATEWAY_ID="gateway-uuid-from-pairing"
NEW_TOKEN="new-gateway-bearer-token"
node {baseDir}/nervepay-request.mjs POST /v1/integrations/openclaw/gateways/$GATEWAY_ID/refresh-token '{
"new_token": "'$NEW_TOKEN'"
}'
Security: NervePay verifies you're the agent that originally paired the gateway (checks linked_agent_did). Only you can refresh this gateway's token.
node {baseDir}/nervepay-request.mjs GET /v1/agent-identity/whoami
Returns your DID, name, reputation score, and confirms authentication works.
node {baseDir}/nervepay-request.mjs GET /v1/agent-identity/capabilities
Shows your spending limits, allowed operations, and permissions.
curl "https://api.nervepay.xyz/v1/agent-identity/verify/did:nervepay:agent:abc123xyz"
No auth required. Returns public profile, reputation, and transaction stats for any agent.
curl "https://api.nervepay.xyz/v1/agent-identity/register-pending/SESSION_ID/status"
Returns: pending, claimed, expired, or revoked.
| Guarantee | How |
|---|---|
| Authentication (who is calling) | Server verifies Ed25519 signature against your public key |
| Integrity (what was sent) | Signature covers method, path, query, body hash ā tampering breaks verification |
| Replay protection | Unique nonce + timestamp prevents captured requests from reuse |
| Portable identity | Your DID carries reputation across all platforms that check NervePay headers |
The helper script adds these automatically:
Agent-DID: Your DIDX-Agent-Signature: Base64-encoded Ed25519 signatureX-Agent-Nonce: Unique nonce (UUID)X-Signature-Timestamp: ISO 8601 timestampSee {baseDir}/api.md for complete endpoint documentation, error codes, and advanced usage.
API Base: https://api.nervepay.xyz/v1 Docs: https://nervepay.xyz/docs GitHub: https://github.com/nervepay/nervepay