### Onboard AgentCash from Terminal Source: https://agentcash.dev/docs/quickstart This command-line interface (CLI) command allows users to onboard AgentCash directly from their terminal. It requires a unique code obtained from the web onboarding process. Running this command sets up the local wallet, installs the AgentCash skill, configures MCP for clients, and redeems the bonus on-chain. ```bash npx agentcash onboard ``` -------------------------------- ### Install AgentCash via CLI Source: https://agentcash.dev/docs/installation/other-clients Executes the automated installation process for AgentCash using the Node Package Execute (npx) tool. This command detects available clients and performs the necessary setup. ```bash npx agentcash install ``` -------------------------------- ### Install OpenClaw Source: https://agentcash.dev/docs/openclaw-setup/for-agents Downloads and runs the OpenClaw installation script on the remote droplet. ```bash ssh root@"$DROPLET_IP" 'bash -s' <<'INSTALL' source ~/.bashrc curl -fsSL https://openclaw.ai/install.sh | OPENCLAW_SKIP_SETUP=1 bash || true INSTALL ``` -------------------------------- ### Onboard to AgentCash via CLI Source: https://agentcash.dev/docs/wallet/funding Executes the onboarding flow to receive free credits. Requires the AgentCash CLI to be installed. ```bash npx agentcash onboard ``` -------------------------------- ### Install Node.js via NVM Source: https://agentcash.dev/docs/openclaw-setup/for-agents Installs NVM and the latest LTS version of Node.js on the remote droplet. ```bash ssh root@"$DROPLET_IP" 'bash -s' <<'NODE' curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash source ~/.bashrc nvm install --lts node --version && npm --version NODE ``` -------------------------------- ### Add AgentCash Skill to Cursor Agent Source: https://agentcash.dev/docs/quickstart This markdown snippet demonstrates how to add the AgentCash skill to a Cursor agent. It involves creating a rule file in the agent's configuration directory or directly instructing the agent to set up the skill URL. ```markdown Set up agentcash.dev/skill.md ``` -------------------------------- ### Configure MCP Server for Zed Source: https://agentcash.dev/docs/installation/other-clients Specific configuration format for the Zed editor's context_servers settings. It uses a nested object structure to define the path and arguments for the npx command. ```json { "context_servers": { "agentcash": { "command": { "path": "npx", "args": ["-y", "agentcash@latest"] } } } } ``` -------------------------------- ### Verify OpenClaw Installation Source: https://agentcash.dev/docs/openclaw-setup/for-agents Checks the installed version of OpenClaw to confirm successful installation. This command is intended to be run after the setup process. ```bash openclaw --version ``` -------------------------------- ### Install and Authenticate doctl Source: https://agentcash.dev/docs/openclaw-setup/for-agents Installs the DigitalOcean CLI (doctl) on macOS or Linux and authenticates using an API token. ```bash # macOS brew install doctl # Linux (snap) snap install doctl # Linux (manual) curl -sL https://github.com/digitalocean/doctl/releases/latest/download/doctl-$(curl -s https://api.github.com/repos/digitalocean/doctl/releases/latest | grep tag_name | cut -d'"' -f4 | tr -d v)-linux-amd64.tar.gz | tar xz -C /usr/local/bin # Authenticate doctl auth init --access-token "$DIGITALOCEAN_API_TOKEN" ``` -------------------------------- ### Configure MCP Server for Standard Clients Source: https://agentcash.dev/docs/installation/other-clients Standard JSON configuration for MCP-compatible clients including Codex, Windsurf, Warp, Gemini CLI, Goose, and Cline. It defines the command as 'npx' with arguments to fetch the latest version of the agentcash package. ```json { "mcpServers": { "agentcash": { "command": "npx", "args": ["-y", "agentcash@latest"] } } } ``` -------------------------------- ### Explore new API origins Source: https://agentcash.dev/docs/cli/fetch Fetches resources from an unfamiliar origin and generates a prompt to guide the user through the first endpoint call. ```bash npx agentcash try ``` -------------------------------- ### Manage wallet funding and accounts via CLI Source: https://agentcash.dev/docs/wallet/funding Provides commands to open the guided funding flow or retrieve deposit links and addresses for supported networks. ```bash npx agentcash fund npx agentcash accounts ``` -------------------------------- ### Install AgentCash MCP Mode (Bash) Source: https://agentcash.dev/docs/cli/install Installs AgentCash as an MCP server for an AI client. It can detect clients interactively or be configured for a specific client using the --client option. This command is essential for integrating AgentCash with various AI client applications. ```bash npx agentcash install [--client ] ``` ```bash npx agentcash install ``` ```bash npx agentcash install --client cursor ``` -------------------------------- ### Install AgentCash using npx Source: https://agentcash.dev/docs/openclaw-setup/for-agents Installs the latest version of AgentCash on a remote server via SSH. This command requires the DROPLET_IP environment variable to be set. It enables OpenClaw to access paid APIs. ```bash ssh root@"$DROPLET_IP" 'npx agentcash@latest onboard' ``` -------------------------------- ### Install AgentCash MCP Server for Cursor (Bash) Source: https://agentcash.dev/docs/mcp-mode Installs the AgentCash MCP server for the Cursor AI client. This command configures Cursor to interact with AgentCash tools. ```bash npx agentcash install --client cursor ``` -------------------------------- ### Secure Onboarding with Environment References Source: https://agentcash.dev/docs/openclaw-setup/for-agents Performs onboarding using environment variable references instead of plaintext keys for enhanced security. Requires the API key to be present in the daemon's environment. ```bash ssh root@"$DROPLET_IP" "bash -s" <<'ONBOARD' export NODE_OPTIONS="--max-old-space-size=1536" openclaw onboard --non-interactive \ --mode local \ --auth-choice openai-api-key \ --secret-input-mode ref \ --accept-risk \ --gateway-port 18789 \ --gateway-bind loopback \ --install-daemon \ --daemon-runtime node \ --skip-skills ONBOARD ``` -------------------------------- ### Open Funding Page via CLI Source: https://agentcash.dev/docs/cli/wallet Launches the AgentCash funding page in the default system browser for the current wallet. ```bash npx agentcash fund ``` -------------------------------- ### Non-Interactive Onboarding for LLM Providers Source: https://agentcash.dev/docs/openclaw-setup/for-agents Automates the onboarding process for Anthropic and OpenAI providers using SSH. It configures the gateway daemon, authentication, and network settings without requiring manual input. ```bash ssh root@"$DROPLET_IP" "bash -s" <` (deprecated alias for `npx agentcash fetch `) ### Method POST ### Endpoint `/tools/fetch_with_auth` ### Parameters #### Request Body - **url** (string) - Required - The URL to fetch. - **method** (string) - Optional - HTTP method. One of `GET`, `POST`, `PUT`, `PATCH`, `DELETE`. Defaults to `GET`. - **body** (string) - Optional - Raw request body string. - **headers** (string[]) - Optional - Additional HTTP headers. Each entry must be a string in `Name: value` format. - **timeout** (number) - Optional - Request timeout in milliseconds. ### Request Example ```json { "url": "https://agentcash.dev/api/data", "method": "POST", "body": "{\"key\": \"value\"}", "headers": ["Content-Type: application/json"], "timeout": 5000 } ``` ### Response #### Success Response (200) - **data** (object) - The parsed response body from the endpoint. - **paymentInfo** (object) - Payment details, present when the request still required payment after the SIWX retry. #### Response Example ```json { "data": { "message": "Success!" }, "paymentInfo": null } ``` ### Behavior 1. Sends the initial request. 2. If the response includes a SIWX challenge, extracts the challenge. 3. Signs the challenge with your wallet's private key. 4. Retries the request with signed auth headers. 5. If the route still returns `402`, pays and retries again. 6. Returns the final response. ### When to use Prefer `fetch` for new integrations. Keep `fetch_with_auth` only for compatibility with older prompts or clients. ``` -------------------------------- ### Fetch API Endpoint Source: https://agentcash.dev/docs/tools/fetch The fetch tool sends an HTTP request to any URL and automatically handles SIWX authentication and payment if the endpoint requires them. ```APIDOC ## POST /fetch ### Description Make HTTP requests with automatic SIWX authentication and payment handling. ### Method POST ### Endpoint /fetch ### Parameters #### Request Body - **url** (string) - Required - The URL to fetch. - **method** (string) - Optional - HTTP method. One of `GET`, `POST`, `PUT`, `PATCH`, `DELETE`. Defaults to `GET`. - **body** (string) - Optional - Raw request body string. When provided, `Content-Type: application/json` is set by default unless overridden by a header entry. - **headers** (string[]) - Optional - Additional HTTP headers. Each entry must be a string in `Name: value` format. - **timeout** (number) - Optional - Request timeout in milliseconds. - **paymentProtocol** (string) - Optional - Force a specific payment protocol: `x402` or `mpp`. By default, AgentCash auto-selects. - **paymentNetwork** (string) - Optional - Preferred network for SIWX and payment when applicable. By default, AgentCash auto-selects. - **maxAmount** (number) - Optional - Maximum amount (in USD) to pay if the route still requires payment. ### Request Example ```json { "url": "https://stableenrich.dev/api/company/lookup", "method": "POST", "body": "{\"domain\": \"stripe.com\"}" } ``` ### Response #### Success Response (200) - **data** (object) - The parsed response body from the endpoint. - **paymentInfo** (object) - Payment details, present when a 402 payment was made. - **amount** (string) - USDC amount paid. - **transaction** (string) - On-chain transaction hash. - **network** (string) - Chain used for the payment. #### Response Example ```json { "data": { "company": { "domain": "stripe.com", "name": "Stripe, Inc.", "logo": "https://logo.clearbit.com/stripe.com" } }, "paymentInfo": { "amount": "0.01", "transaction": "0xabc123...", "network": "ethereum" } } ``` ``` -------------------------------- ### Provision DigitalOcean Droplet Source: https://agentcash.dev/docs/openclaw-setup/for-agents Imports an SSH key, creates a new Ubuntu droplet, and retrieves its public IP address. ```bash doctl compute ssh-key import openclaw-key --public-key-file ~/.ssh/id_ed25519.pub doctl compute droplet create openclaw1 \ --region nyc1 \ --size s-1vcpu-2gb \ --image ubuntu-24-04-x64 \ --ssh-keys "$(doctl compute ssh-key list --format ID --no-header | head -1)" \ --wait \ --format ID,Name,PublicIPv4 \ --no-header DROPLET_IP=$(doctl compute droplet get openclaw1 --format PublicIPv4 --no-header) echo "$DROPLET_IP" ``` -------------------------------- ### Interactive OAuth Onboarding Source: https://agentcash.dev/docs/openclaw-setup/for-agents Handles providers requiring browser-based OAuth authentication. This requires a TTY session and manual user intervention to complete the login flow. ```bash ssh -t root@"$DROPLET_IP" 'NODE_OPTIONS="--max-old-space-size=1536" openclaw onboard --install-daemon --skip-skills' ``` -------------------------------- ### Check Wallet Balance via CLI Source: https://agentcash.dev/docs/cli/wallet Retrieves the total USDC balance across supported networks. Automatically initializes a wallet if one is not present. ```bash npx agentcash balance ``` -------------------------------- ### Configure Swap Memory Source: https://agentcash.dev/docs/openclaw-setup/for-agents Allocates and enables a 2GB swap file on the remote server to prevent out-of-memory errors. ```bash ssh root@"$DROPLET_IP" 'bash -s' <<'SWAP' fallocate -l 2G /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swapfile echo "/swapfile none swap sw 0 0" >> /etc/fstab echo "Swap enabled: $(swapon --show)" SWAP ``` -------------------------------- ### Format CLI Output as JSON Source: https://agentcash.dev/docs/cli/wallet Appends the --format json flag to wallet commands to receive machine-readable output. ```bash npx agentcash balance --format json ``` -------------------------------- ### Manage Models and Configuration Source: https://agentcash.dev/docs/openclaw-setup/for-agents Commands to list available models, set the default model for the agent, and restart the gateway to apply changes. ```bash ssh root@"$DROPLET_IP" 'openclaw models list --all' ssh root@"$DROPLET_IP" 'openclaw models set ' ssh root@"$DROPLET_IP" 'openclaw gateway restart' ``` -------------------------------- ### Discover API endpoints on an origin using AgentCash CLI Source: https://agentcash.dev/docs/guides/discovering-endpoints Fetches the discovery document from a specified origin to list all available endpoints, their descriptions, and pricing. This command requires the target origin URL as an argument. ```bash npx agentcash discover https://stableenrich.dev ``` -------------------------------- ### Troubleshoot Gateway and System Issues Source: https://agentcash.dev/docs/openclaw-setup/for-agents Diagnostic commands to resolve memory issues, port conflicts, and model configuration errors on the remote droplet. ```bash # Increase Node heap ssh root@"$DROPLET_IP" 'export NODE_OPTIONS="--max-old-space-size=1536" && openclaw onboard --install-daemon' # Check logs ssh root@"$DROPLET_IP" 'journalctl -u openclaw --no-pager -n 50' # Model management ssh root@"$DROPLET_IP" 'openclaw models list --all' ssh root@"$DROPLET_IP" 'openclaw models set ' ``` -------------------------------- ### POST /redeem_invite Source: https://agentcash.dev/docs/tools/redeem-invite Redeems an invite code to deposit USDC into the user's wallet on the Base network. ```APIDOC ## POST /redeem_invite ### Description The `redeem_invite` tool redeems an invite code to deposit USDC into your wallet on Base. Each code is one-time use. ### Method POST ### Endpoint /redeem_invite ### Parameters #### Request Body - **code** (string) - Required - The invite code to redeem. ### Request Example { "code": "ABC123" } ### Response #### Success Response (200) - **amount** (string) - Amount of USDC deposited. - **transaction** (string) - On-chain transaction hash on Base. #### Response Example { "amount": "10.00", "transaction": "0xabc123..." } ``` -------------------------------- ### Manage Communication Channels Source: https://agentcash.dev/docs/openclaw-setup/for-agents Commands to enable and configure messaging channels like Telegram and WhatsApp. Includes pairing approval and interactive login procedures. ```bash # Telegram Setup ssh root@"$DROPLET_IP" "openclaw config set channels.telegram.enabled true" ssh root@"$DROPLET_IP" "openclaw config set channels.telegram.botToken \"$TELEGRAM_BOT_TOKEN\"" ssh root@"$DROPLET_IP" "openclaw gateway restart" # Approve Pairing ssh root@"$DROPLET_IP" 'openclaw pairing approve telegram ' # WhatsApp Login ssh -t root@"$DROPLET_IP" 'openclaw channels login whatsapp' ``` -------------------------------- ### Open DigitalOcean Registration and Token Pages Source: https://agentcash.dev/docs/openclaw-setup/for-agents Opens the browser to the DigitalOcean signup or API token creation pages. Includes fallback commands for Linux environments. ```bash open "https://cloud.digitalocean.com/registrations/new" # Linux: xdg-open "https://cloud.digitalocean.com/registrations/new" open "https://cloud.digitalocean.com/account/api/tokens/new" # Linux: xdg-open "https://cloud.digitalocean.com/account/api/tokens/new" ``` -------------------------------- ### Redeem Invite Code via CLI Source: https://agentcash.dev/docs/cli/wallet Redeems a one-time use invite code for USDC on the Base network. ```bash npx agentcash redeem ``` -------------------------------- ### Configure Remote Network Access Source: https://agentcash.dev/docs/openclaw-setup/for-agents Methods to expose the gateway using Tailscale Serve or Tailnet binding. These commands update the gateway configuration and restart the service. ```bash # Tailscale Serve ssh root@"$DROPLET_IP" 'bash -s' <<'TAILSCALE' curl -fsSL https://tailscale.com/install.sh | sh tailscale up openclaw config set gateway.tailscale.mode serve openclaw gateway restart TAILSCALE # Tailnet Bind ssh root@"$DROPLET_IP" 'bash -s' <<'TAILNET' openclaw config set gateway.bind tailnet openclaw gateway restart TAILNET ``` -------------------------------- ### Check endpoint schema and auth requirements Source: https://agentcash.dev/docs/cli/fetch Retrieves input/output schemas and authentication modes for a given endpoint. It is recommended to run this before fetching to ensure correct field names and avoid 400 errors. ```bash npx agentcash check [options] ``` ```bash npx agentcash check https://stableenrich.dev/api/apollo/people-enrich ``` -------------------------------- ### Redeem invite code via CLI Source: https://agentcash.dev/docs/wallet/funding Redeems a one-time invite code to deposit USDC into your wallet. Replace YOUR_CODE with your specific invite string. ```bash npx agentcash redeem YOUR_CODE ``` -------------------------------- ### Discover API endpoints Source: https://agentcash.dev/docs/cli/fetch Lists available endpoints for a specified API origin, including descriptions and authentication modes. Useful for exploring the capabilities of any API origin. ```bash npx agentcash discover [options] ``` ```bash npx agentcash discover https://stableenrich.dev ``` -------------------------------- ### Check Endpoint Schema Source: https://agentcash.dev/docs/tools/check-endpoint-schema Inspect an endpoint for pricing, authentication requirements, and schema details without making a payment. This tool helps understand API specifications before integration. ```APIDOC ## POST /check_endpoint_schema ### Description Probe an endpoint for pricing, auth requirements, and schema without paying. The `check_endpoint_schema` tool inspects an endpoint to learn its price, supported methods, input/output schema, and auth mode without making a payment. Equivalent CLI command: `npx agentcash check ` ### Method POST ### Endpoint /check_endpoint_schema ### Parameters #### Request Body - **url** (string) - Required - The endpoint URL to check. - **method** (string) - Optional - Specific HTTP method to probe. If omitted, AgentCash probes multiple methods and checks the OpenAPI spec. - **headers** (string[]) - Optional - Additional headers to include. Each entry must use `Name: value` format. ### Response #### Success Response (200) - **price** (string) - Cost per request in USDC. - **methods** (string[]) - Supported HTTP methods (GET, POST, etc.). - **inputSchema** (object) - Expected request body format (JSON schema). - **outputSchema** (object) - Response body format (JSON schema). - **authType** (string) - Authentication mode: `x402`, `siwx`, `mpp`, or `none`. ### Request Example ```json { "url": "https://stableenrich.dev/api/company/lookup", "method": "POST", "headers": [ "Authorization: Bearer YOUR_API_KEY" ] } ``` ### Response Example ```json { "price": "0.001 USDC", "methods": ["POST", "GET"], "inputSchema": { "type": "object", "properties": { "companyName": { "type": "string" } }, "required": ["companyName"] }, "outputSchema": { "type": "object", "properties": { "companyId": { "type": "string" }, "companyName": { "type": "string" } } }, "authType": "x402" } ``` ### Behavior 1. Sends a probe request to the endpoint 2. Reads the `402 Payment Required` response for pricing and auth details 3. Fetches the OpenAPI spec (if available) for schema information 4. Probes multiple HTTP methods in parallel to determine which are supported 5. Returns all metadata without making a payment ``` -------------------------------- ### Fetch API resources with AgentCash Source: https://agentcash.dev/docs/cli/fetch Sends authenticated HTTP requests with automatic SIWX and payment handling. Use this to interact with endpoints that require payment or authentication. ```bash npx agentcash fetch [options] ``` ```bash npx agentcash fetch https://stableenrich.dev/api/apollo/people-enrich \ -m POST \ -b '{"email":"user@example.com"}' ``` -------------------------------- ### Validate AgentCash Discovery via CLI Source: https://agentcash.dev/docs/guides/server-discovery Commands to validate an API's OpenAPI document against AgentCash discovery standards using the official discovery package. ```bash npx -y @agentcash/discovery@latest discover "$TARGET_URL" npx -y @agentcash/discovery@latest check "$TARGET_URL" ``` -------------------------------- ### Verify Gateway Status Source: https://agentcash.dev/docs/openclaw-setup/for-agents Runs diagnostic checks on the OpenClaw gateway to ensure all services are running correctly after onboarding. ```bash ssh root@"$DROPLET_IP" 'bash -s' <<'VERIFY' openclaw status openclaw doctor --non-interactive openclaw gateway status VERIFY ``` -------------------------------- ### Wait for SSH Availability Source: https://agentcash.dev/docs/openclaw-setup/for-agents Polls the droplet until the SSH service is ready to accept connections. ```bash until ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=accept-new root@"$DROPLET_IP" 'echo ready' 2>/dev/null; do sleep 5 done ``` -------------------------------- ### Check specific endpoint schema and pricing using AgentCash CLI Source: https://agentcash.dev/docs/guides/discovering-endpoints Inspects a single API endpoint to retrieve its pricing, supported HTTP methods, input/output schemas, and authentication requirements. This allows developers to evaluate endpoints without executing paid requests. ```bash npx agentcash check https://stableenrich.dev/api/company/lookup ``` -------------------------------- ### Define AgentCash Compliant OpenAPI Schema Source: https://agentcash.dev/docs/guides/server-discovery A minimal OpenAPI 3.1.0 JSON structure demonstrating required fields for AgentCash, including x-payment-info, 402 response handling, and x-guidance for AI agents. ```json { "openapi": "3.1.0", "info": { "title": "My API", "version": "1.0.0", "description": "example demo server", "x-guidance": "Use POST /api/search for neural web search. Accepts a JSON body with a 'query' field." }, "x-discovery": { "ownershipProofs": [""] }, "paths": { "/api/search": { "post": { "operationId": "search", "summary": "Search - Neural search across the web", "tags": ["Search"], "x-payment-info": { "pricingMode": "fixed", "price": "0.010000", "protocols": ["x402", "mpp"] }, "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "query": { "type": "string", "minLength": 1, "description": "The query string for the search" } }, "required": ["query"] } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object" } } }, "required": ["results"] } } } }, "402": { "description": "Payment Required" } } } } } } ``` -------------------------------- ### Retrieve Gateway Authentication Token Source: https://agentcash.dev/docs/openclaw-setup/for-agents Extracts the gateway authentication token from the remote configuration file using a one-line Python command executed over SSH. ```bash ssh root@"$DROPLET_IP" "python3 -c \"import json; print(json.load(open('/root/.openclaw/openclaw.json'))['auth']['token'])\"" ``` -------------------------------- ### Establish SSH Tunneling for Gateway Access Source: https://agentcash.dev/docs/openclaw-setup/for-agents Commands to verify local port availability and establish an SSH tunnel to the remote OpenClaw gateway. This allows secure access to the web interface via localhost. ```bash lsof -i :18789 2>/dev/null && echo "Port in use — pick another local port or kill the process" || echo "Port free" ssh -f -N -L 18789:localhost:18789 root@"$DROPLET_IP" ``` -------------------------------- ### Register API origin Source: https://agentcash.dev/docs/cli/fetch Registers an API origin with AgentCash by automatically discovering and indexing its available endpoints. ```bash npx agentcash register ``` ```bash npx agentcash register https://stableenrich.dev ``` -------------------------------- ### Generate SSH Key Pair Source: https://agentcash.dev/docs/openclaw-setup/for-agents Generates a new Ed25519 SSH key pair for secure authentication to the remote droplet. ```bash ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" ``` -------------------------------- ### Add AgentCash MCP Server for Claude Code (Bash) Source: https://agentcash.dev/docs/mcp-mode Adds AgentCash as an MCP server specifically for the Claude Code client. This command ensures AgentCash tools are available within the Claude Code environment. ```bash claude mcp add agentcash --scope user -- npx -y agentcash@latest ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.