### Install OpenClaw Source: https://agentcash.dev/docs/openclaw-setup/for-agents Installs the OpenClaw binary without launching the interactive setup wizard. Verify the installation by checking the version. ```bash curl -fsSL https://openclaw.ai/install.sh | OPENCLAW_SKIP_SETUP=1 bash || true openclaw --version ``` -------------------------------- ### Interactive AgentCash Install Source: https://agentcash.dev/docs/cli/install Run the install command without any options to start an interactive prompt for client detection and selection. ```bash npx agentcash install ``` -------------------------------- ### Onboard for Free Credits via CLI Source: https://agentcash.dev/docs/wallet/funding Use this command to onboard and receive up to $25 in free credits. This is the fastest way to get started. ```bash npx agentcash onboard ``` -------------------------------- ### Direct AgentCash Install for Cursor Source: https://agentcash.dev/docs/cli/install Specify the client directly using the --client option to bypass the interactive prompt. This example installs for the Cursor client. ```bash npx agentcash install --client cursor ``` -------------------------------- ### Install OpenClaw Source: https://agentcash.dev/docs/openclaw-setup/for-agents Installs OpenClaw on the droplet. This command assumes Node.js and npm are already installed and configured. ```bash ssh root@"$DROPLET_IP" 'bash -s' <<'INSTALL' source ~/.bashrc ``` -------------------------------- ### CLI Installation Source: https://agentcash.dev/docs/cli/overview Instructions on how to install the AgentCash CLI globally using npm or run commands directly with npx. ```APIDOC ## CLI Installation Use AgentCash from the command line. The `agentcash` CLI is the primary interface for AgentCash. Use it to discover premium APIs, make paid requests, manage your wallet, add skills, and install [MCP mode](/mcp-mode) for AI clients. ### Install ```bash npm i -g agentcash ``` Or run commands directly with `npx`: ```bash npx agentcash [options] ``` ``` -------------------------------- ### Install Node.js LTS using NVM Source: https://agentcash.dev/docs/openclaw-setup/for-agents Installs Node Version Manager (nvm) and then installs the latest Long Term Support (LTS) version of Node.js on the droplet. It also verifies the installation by printing the Node.js and npm versions. ```bash ssh root@"$DROPLET_IP" 'bash -s' <<'NODE' # Install nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash source ~/.bashrc # Install Node.js LTS nvm install --lts # Verify node --version && npm --version NODE ``` -------------------------------- ### Initiate Guided Funding Flow via CLI Source: https://agentcash.dev/docs/wallet/funding Open the guided funding flow for your AgentCash wallet using this command. ```bash npx agentcash fund ``` -------------------------------- ### Install doctl CLI Source: https://agentcash.dev/docs/openclaw-setup/for-agents Installs the DigitalOcean command-line interface (doctl). Choose the command appropriate for your operating system (macOS, Linux snap, or manual Linux install). ```bash # macOS brew install doctl ``` ```bash # Linux (snap) snap install doctl ``` ```bash # 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 ``` -------------------------------- ### Install AgentCash CLI Source: https://agentcash.dev/docs/cli/overview Install the AgentCash CLI globally using npm. ```bash npm i -g agentcash ``` -------------------------------- ### Install AgentCash using npx Source: https://agentcash.dev/docs/openclaw-setup/for-agents Installs the latest version of AgentCash globally using npx. This command is required after OpenClaw setup to enable paid API access. ```bash ssh root@"$DROPLET_IP" 'npx agentcash@latest onboard' ``` -------------------------------- ### Onboard with Env-Ref Mode Source: https://agentcash.dev/docs/openclaw-setup/for-agents Performs non-interactive onboarding using environment variable references instead of plaintext API keys. The environment variable must be present when the daemon starts. ```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 ``` -------------------------------- ### agentcash try Source: https://agentcash.dev/docs/cli/fetch Fetches a new origin's resources and returns a prompt guiding you through calling the first endpoint. This is useful for exploring an unfamiliar origin. ```APIDOC ## POST /api/try ### Description Fetches resources from a new origin and provides a prompt to guide the user through calling the first endpoint. ### Method POST ### Endpoint /api/try ### Parameters #### Query Parameters - **url** (string) - Required - The origin URL to explore. ### Request Example ```json { "url": "https://stableenrich.dev" } ``` ### Response #### Success Response (200) - **prompt** (string) - A prompt guiding the user on how to call the first endpoint. #### Response Example ```json { "prompt": "To get started, try calling the /api/apollo/people-enrich endpoint. You can use the 'fetch' command: npx agentcash fetch https://stableenrich.dev/api/apollo/people-enrich -m POST -b '{\"email\":\"user@example.com\"}'" } ``` ``` -------------------------------- ### Install AgentCash for Cursor Source: https://agentcash.dev/docs/mcp-mode Configure AgentCash for Cursor via CLI or manual JSON configuration. ```bash npx agentcash install --client cursor ``` ```json { "mcpServers": { "agentcash": { "command": "npx", "args": ["-y", "agentcash@latest"] } } } ``` -------------------------------- ### Resize Droplet Source: https://agentcash.dev/docs/openclaw-setup/for-agents If memory issues persist, consider resizing the droplet to a larger instance. This example resizes to a 2GB RAM instance. ```bash # Or resize the droplet (if using the $6 plan) doctl compute droplet-action resize openclaw1 --size s-1vcpu-2gb --wait ``` -------------------------------- ### Check Gateway Status and Run Diagnostics Source: https://agentcash.dev/docs/openclaw-setup/for-agents These commands help diagnose issues when the gateway fails to start. Check the status and run non-interactive diagnostics. ```bash ssh root@"$DROPLET_IP" 'openclaw gateway status && openclaw doctor --non-interactive' ``` -------------------------------- ### Run AgentCash Commands Source: https://agentcash.dev/docs/cli/overview Execute AgentCash commands directly without global installation using npx. ```bash npx agentcash [options] ``` -------------------------------- ### Install AgentCash MCP for a specific project Source: https://agentcash.dev/docs/installation/claude-code Omit the --scope flag to restrict the AgentCash MCP tool to the current project directory, writing settings to .claude/settings.local.json. ```bash claude mcp add agentcash -- npx -y agentcash@latest ``` -------------------------------- ### Install AgentCash MCP globally Source: https://agentcash.dev/docs/installation/claude-code Use the --scope user flag to make the AgentCash MCP tool available across all Claude Code sessions. ```bash claude mcp add agentcash --scope user -- npx -y agentcash@latest ``` -------------------------------- ### Configure Tailscale Serve for Secure Dashboard Access Source: https://agentcash.dev/docs/openclaw-setup/for-agents This script installs Tailscale, enables it, configures the Openclaw gateway to use Tailscale Serve mode for HTTPS access, and restarts the gateway. Access the dashboard via `https:///`. ```bash 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 ``` -------------------------------- ### Check System Memory Source: https://agentcash.dev/docs/openclaw-setup/for-agents Use this command to check the available memory on the droplet, useful for troubleshooting out-of-memory errors during setup. ```bash # Check memory ssh root@"$DROPLET_IP" 'free -h' ``` -------------------------------- ### Install AgentCash MCP Mode Source: https://agentcash.dev/docs/cli/install Use this command to set up AgentCash as an MCP server for your AI client. Without the --client option, it will prompt you to select a client. ```bash npx agentcash install [--client ] ``` -------------------------------- ### Try New API Origin Source: https://agentcash.dev/docs/cli/fetch Fetches a new origin's resources and returns a prompt guiding you through calling the first endpoint. Good for exploring an unfamiliar origin. ```bash npx agentcash try ``` -------------------------------- ### Get Wallet Balance in JSON Format Source: https://agentcash.dev/docs/cli/wallet Adds `--format json` to any wallet-related command for machine-readable output. ```bash npx agentcash balance --format json ``` -------------------------------- ### Verify Gateway Status Source: https://agentcash.dev/docs/openclaw-setup/for-agents Checks the status of the OpenClaw installation and gateway daemon. ```bash ssh root@"$DROPLET_IP" 'bash -s' <<'VERIFY' openclaw status openclaw doctor --non-interactive openclaw gateway status VERIFY ``` -------------------------------- ### Get Wallet Balance Source: https://agentcash.dev/docs/tools/get-balance Retrieves your total USDC balance across all supported networks. ```APIDOC ## GET /balance ### Description Get your total wallet balance. The `get_balance` tool returns your total USDC balance across all supported networks. ### Method GET ### Endpoint /balance ### Parameters This tool takes no parameters. ### Response #### Success Response (200) - **balance** (number) - Total USDC balance across all supported networks. #### Response Example { "balance": 100.50 } ``` -------------------------------- ### Check API Endpoint Schema Source: https://agentcash.dev/docs/cli/fetch Gets the input/output schema and auth mode for an endpoint. Call this before fetch to avoid 400 errors from wrong field names. ```bash npx agentcash check [options] ``` ```bash npx agentcash check https://stableenrich.dev/api/apollo/people-enrich ``` -------------------------------- ### Retrieve Gateway Authentication Token Source: https://agentcash.dev/docs/openclaw-setup/for-agents This command retrieves the gateway authentication token, which is necessary for accessing the dashboard. Ensure you have Python 3 installed on the droplet. ```bash ssh root@"$DROPLET_IP" "python3 -c \"import json; print(json.load(open('/root/.openclaw/openclaw.json'))['auth']['token'])\"" ``` -------------------------------- ### agentcash check Source: https://agentcash.dev/docs/cli/fetch Gets the input/output schema and auth mode (paid or SIWX) for an endpoint. Returns exact field names from the OpenAPI spec. This is useful to call before `fetch` to avoid 400 errors due to incorrect field names. ```APIDOC ## POST /api/check ### Description Gets the input/output schema and authentication mode for an endpoint. ### Method POST ### Endpoint /api/check ### Parameters #### Query Parameters - **url** (string) - Required - The URL of the endpoint to check. - **header** (string) - Optional - HTTP header in `Name: value` format (repeatable). - **body** (string) - Optional - Probe the endpoint live for an exact price quote (useful when pricing is range-based). ### Request Example ```json { "url": "https://stableenrich.dev/api/apollo/people-enrich" } ``` ### Response #### Success Response (200) - **schema** (object) - The input/output schema for the endpoint. - **auth_mode** (string) - The authentication mode (e.g., 'paid', 'siwx'). #### Response Example ```json { "schema": { "input": { "type": "object", "properties": { "email": {"type": "string"} } }, "output": { "type": "object", "properties": { "name": {"type": "string"} } } }, "auth_mode": "paid" } ``` ``` -------------------------------- ### Discover endpoints on an origin using CLI Source: https://agentcash.dev/docs/guides/discovering-endpoints Use this command to fetch the discovery document from an origin and list available endpoints with descriptions and pricing. ```bash npx agentcash discover https://stableenrich.dev ``` -------------------------------- ### Onboard Anthropic or OpenAI Source: https://agentcash.dev/docs/openclaw-setup/for-agents Performs non-interactive onboarding for Anthropic or OpenAI providers using API keys. Requires the DROPLET_IP environment variable to be set. ```bash ssh root@"$DROPLET_IP" "bash -s" <' ``` ```bash ssh root@"$DROPLET_IP" 'openclaw gateway restart' ``` -------------------------------- ### Onboard AgentCash from Terminal Source: https://agentcash.dev/docs/quickstart Use this command to onboard AgentCash from your terminal if you have a claim code or wish to skip the web flow. Running without a code and no existing balance will link to the web onboarding. ```bash npx agentcash onboard ``` -------------------------------- ### Get Droplet IP Address Source: https://agentcash.dev/docs/openclaw-setup/for-agents Retrieves the public IPv4 address of the 'openclaw1' droplet. This IP is needed to establish an SSH connection. ```bash DROPLET_IP=$(doctl compute droplet get openclaw1 --format PublicIPv4 --no-header) echo "$DROPLET_IP" ``` -------------------------------- ### Set Private Key Environment Variable Source: https://agentcash.dev/docs/wallet/overview Use this command to set the X402_PRIVATE_KEY environment variable. This is useful for CI/CD or sharing a wallet across machines. ```bash export X402_PRIVATE_KEY=0xYOUR_PRIVATE_KEY ``` -------------------------------- ### List account details Source: https://agentcash.dev/docs/wallet/networks Retrieve per-network balances, wallet addresses, and deposit links. ```shell npx agentcash accounts ``` ```text list_accounts ``` -------------------------------- ### Handle OpenAI Codex OAuth Source: https://agentcash.dev/docs/openclaw-setup/for-agents Interactive onboarding for OAuth providers and subsequent configuration adjustments. Requires manual user intervention for browser authentication. ```bash ssh -t root@"$DROPLET_IP" 'NODE_OPTIONS="--max-old-space-size=1536" openclaw onboard --install-daemon --skip-skills' ``` ```bash ssh root@"$DROPLET_IP" 'openclaw config set agents.defaults.memorySearch.enabled false' ssh root@"$DROPLET_IP" 'openclaw gateway restart' ``` -------------------------------- ### Fetch Tool API 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. ### 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. ### Request Example ```json { "url": "https://stableenrich.dev/api/company/lookup", "method": "POST", "body": "{\"domain\": \"stripe.com\"}" } ``` ### Response Example ```json { "data": { "company": { "domain": "stripe.com", "name": "Stripe, Inc." } }, "paymentInfo": { "amount": "0.01", "transaction": "0xabc123...", "network": "ethereum" } } ``` ``` -------------------------------- ### View Account Details for Direct Deposit via CLI Source: https://agentcash.dev/docs/wallet/funding Retrieve deposit links and addresses for supported networks to manually deposit USDC. This command displays account details. ```bash npx agentcash accounts ``` -------------------------------- ### Redeem Invite Code via CLI Source: https://agentcash.dev/docs/wallet/funding Redeem an invite code using the CLI to deposit USDC directly to your wallet on Base. Invite codes are single-use. ```bash npx agentcash redeem YOUR_CODE ``` -------------------------------- ### Fetch API Endpoint with Authentication Source: https://agentcash.dev/docs/cli/fetch Sends an HTTP request with automatic SIWX authentication and payment handling. Use to make authenticated and paid HTTP requests. ```bash npx agentcash fetch [options] ``` ```bash npx agentcash fetch https://stableenrich.dev/api/apollo/people-enrich \ -m POST \ -b '{"email":"user@example.com"}' ``` -------------------------------- ### Redeem Invite Code for USDC Source: https://agentcash.dev/docs/cli/wallet Redeems an invite code for USDC on Base. Codes are one-time use. ```bash npx agentcash redeem ``` -------------------------------- ### Open DigitalOcean Signup/API Token Page Source: https://agentcash.dev/docs/openclaw-setup/for-agents Opens the DigitalOcean signup page or the API token creation page in the default web browser. Use this if the user needs to create an account or generate an API token. ```bash open "https://cloud.digitalocean.com/registrations/new" # Linux: xdg-open "https://cloud.digitalocean.com/registrations/new" ``` ```bash open "https://cloud.digitalocean.com/account/api/tokens/new" # Linux: xdg-open "https://cloud.digitalocean.com/account/api/tokens/new" ``` -------------------------------- ### Authenticate doctl with API Token Source: https://agentcash.dev/docs/openclaw-setup/for-agents Initializes doctl authentication using a DigitalOcean Personal Access Token. Ensure the DIGITALOCEAN_API_TOKEN environment variable is set. ```bash doctl auth init --access-token "$DIGITALOCEAN_API_TOKEN" ``` -------------------------------- ### Create DigitalOcean Droplet Source: https://agentcash.dev/docs/openclaw-setup/for-agents Creates a new DigitalOcean droplet named 'openclaw1' with specified configurations (region, size, image). It uses the first available SSH key for access and waits for the droplet to be ready. ```bash 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 ``` -------------------------------- ### Configure AgentCash MCP with options Source: https://agentcash.dev/docs/installation/claude-code Pass additional flags to the AgentCash tool after the -- separator to customize behavior, such as enabling verbose output. ```bash claude mcp add agentcash --scope user -- npx -y agentcash@latest --verbose ``` -------------------------------- ### POST /redeem_invite Source: https://agentcash.dev/docs/tools/redeem-invite Redeems an invite code to deposit USDC into a wallet on Base. ```APIDOC ## POST /redeem_invite ### Description The `redeem_invite` tool redeems an invite code to deposit USDC into your wallet on Base. ### Parameters #### Request Body - **code** (string) - Required - The invite code to redeem. ### Response #### Success Response (200) - **amount** (string) - Amount of USDC deposited. - **transaction** (string) - On-chain transaction hash on Base. ### Behavior - Sends the invite code to the AgentCash redemption service - Deposits USDC directly to your wallet on Base - Returns the amount and transaction hash ### Warning Invite codes are one-time use. Each code can only be redeemed once. ``` -------------------------------- ### Configure AgentCash Skill in Cursor Source: https://agentcash.dev/docs/quickstart Add this rule file to your Cursor agent's configuration to set up the AgentCash skill. Alternatively, you can instruct your agent directly via chat. ```markdown Set up agentcash.dev/skill.md ``` -------------------------------- ### Documentation Index Source: https://agentcash.dev/docs/tools/fetch-with-auth Fetch the complete documentation index to discover all available pages. ```APIDOC ## Documentation Index Fetch the complete documentation index at: https://agentcash.dev/docs/llms.txt Use this file to discover all available pages before exploring further. ``` -------------------------------- ### Fetch Command Options Source: https://agentcash.dev/docs/guides/calling-apis The `fetch` command supports standard HTTP request options. AgentCash defaults to `Content-Type: application/json` for requests with a body. ```text URL: https://example.com/api/endpoint Method: POST (default: GET) Headers: {"Content-Type": "application/json"} Body: {"key": "value"} Timeout: 30000 (milliseconds) ``` -------------------------------- ### Discover API Endpoints Source: https://agentcash.dev/docs/tools/discover-api-endpoints This tool fetches the discovery document from an x402-compatible origin and returns a list of all available endpoints. ```APIDOC ## POST /discover_api_endpoints ### Description Find all available endpoints on an origin. ### Method POST ### Endpoint /discover_api_endpoints ### Parameters #### Request Body - **url** (string) - Required - The origin URL to discover endpoints on (e.g., `https://stableenrich.dev`). ### Request Example { "url": "https://stableenrich.dev" } ### Response #### Success Response (200) - **origin** (string) - The origin that was queried. - **endpoints** (object[]) - List of discovered endpoints. - **path** (string) - Endpoint path. - **method** (string) - HTTP method. - **description** (string) - What the endpoint does. - **price** (string) - Cost in USDC. - **instructions** (string) - Usage instructions from the origin, if provided. #### Response Example { "origin": "https://stableenrich.dev", "endpoints": [ { "path": "/v1/images/generations", "method": "POST", "description": "Generates images from a prompt.", "price": "0.0002 USDC" } ], "instructions": "Use the /v1/images/generations endpoint to create images." } ``` -------------------------------- ### CLI Commands Source: https://agentcash.dev/docs/cli/overview A list of available commands for the AgentCash CLI and their descriptions. ```APIDOC ## Commands | Command | Description | | ------------------ | -------------------------------------------------------------------------------------------------- | | `onboard [code]` | Set up wallet, configure MCP, and optionally redeem an invite code | | `discover ` | List available endpoints on an origin with descriptions and auth modes | | `check ` | Get input/output schema and auth mode for an endpoint. Run this before `fetch` to avoid 400 errors | | `fetch ` | HTTP fetch with automatic SIWX auth and payment | | `fetch-auth ` | Deprecated alias for `fetch` | | `try ` | Fetch a new origin's resources and return a prompt for calling the first endpoint | | `register ` | Register an origin with AgentCash (discover + index endpoints) | | `add ` | Add a skill to the AgentCash MCP server | | `balance` | Show total wallet balance | | `accounts` | Show per-network balances, addresses, and deposit links | | `redeem ` | Redeem an invite code | | `fund` | Open the funding page in your browser | | `install` | Install MCP mode for your AI client | | `server` | Start the MCP server (default when no command given) | | `report-error` | Report a critical bug (emergency only) | ``` -------------------------------- ### Add Swap Space to Droplet Source: https://agentcash.dev/docs/openclaw-setup/for-agents Configures a 2GB swap file on the droplet, which is recommended for stability and required for droplets with 1GB RAM. It also updates /etc/fstab to make the swap persistent across reboots. ```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 ``` -------------------------------- ### Check Pricing for an Endpoint Source: https://agentcash.dev/docs/guides/calling-apis Use this prompt to inquire about the cost of an API endpoint before making a payment. This returns pricing details and schema information. ```text Check the pricing for https://stableenrich.dev/api/company/lookup using AgentCash. ``` -------------------------------- ### Check Total USDC Balance Source: https://agentcash.dev/docs/cli/wallet Shows your total USDC balance across supported networks. Creates a wallet automatically if one doesn't exist. ```bash npx agentcash balance ``` -------------------------------- ### List and Set Model for 'Model not found' Error Source: https://agentcash.dev/docs/openclaw-setup/for-agents If you encounter a 'Model not found' error, list all available models and ensure you are setting a valid model ID. Restart the gateway after setting a new model. ```bash # List all available models for your auth ssh root@"$DROPLET_IP" 'openclaw models list --all' ``` ```bash # Set a valid model ssh root@"$DROPLET_IP" 'openclaw models set ' ``` ```bash ssh root@"$DROPLET_IP" 'openclaw gateway restart' ``` -------------------------------- ### Discover API Endpoints Source: https://agentcash.dev/docs/cli/fetch Lists available endpoints at an API origin with descriptions and auth modes. Works with any origin, not just registered ones. ```bash npx agentcash discover [options] ``` ```bash npx agentcash discover https://stableenrich.dev ``` -------------------------------- ### CLI Wallet Commands Source: https://agentcash.dev/docs/cli/wallet Commands for interacting with AgentCash wallet functionality. ```APIDOC ## balance ### Description Shows your total USDC balance across supported networks. Creates a wallet automatically if one doesn't exist. ### Usage `npx agentcash balance [--format json]` ## accounts ### Description Lists each supported network with its balance, wallet address, and deposit link. ### Usage `npx agentcash accounts [--format json]` ## redeem ### Description Redeems an invite code for USDC on Base. Codes are one-time use. ### Parameters #### Path Parameters - **code** (string) - Required - The invite code to redeem. ### Usage `npx agentcash redeem [--format json]` ## fund ### Description Opens the AgentCash funding page for your wallet in your browser. ### Usage `npx agentcash fund [--format json]` ``` -------------------------------- ### List Wallet Accounts Source: https://agentcash.dev/docs/tools/list-accounts Retrieves a list of wallet accounts and their corresponding deposit links for each supported network. This tool automatically creates a wallet if one does not exist. ```APIDOC ## POST /list_accounts ### Description List wallet accounts and deposit links by network. The `list_accounts` tool returns the per-network account list for your AgentCash wallet, including balance, wallet address, and deposit link for each supported network. ### Method POST ### Endpoint /list_accounts ### Parameters This tool takes no parameters. ### Request Example ```json { "example": "No request body needed for this tool." } ``` ### Response #### Success Response (200) - **accounts** (array) - One entry per supported network. - **network** (string) - Supported network name. - **balance** (number) - USDC balance on that network. - **address** (string) - Wallet address for that network. - **depositLink** (string) - Funding link for that network. - **isNewWallet** (boolean) - Whether the wallet is new and likely needs funding. - **onboardingCta** (object) - Present when the user has not completed onboarding. Show its message when returned. #### Response Example ```json { "accounts": [ { "network": "ethereum", "balance": 100.50, "address": "0x123...", "depositLink": "https://agentcash.dev/deposit/ethereum" }, { "network": "polygon", "balance": 50.25, "address": "0x456...", "depositLink": "https://agentcash.dev/deposit/polygon" } ], "isNewWallet": false, "onboardingCta": null } ``` ``` -------------------------------- ### Enable and Configure Telegram Channel Source: https://agentcash.dev/docs/openclaw-setup/for-agents These commands enable the Telegram channel, set the bot token obtained from BotFather, and restart the gateway. The user will receive a pairing code after enabling Telegram. ```bash ssh root@"$DROPLET_IP" "openclaw config set channels.telegram.enabled true" ``` ```bash ssh root@"$DROPLET_IP" "openclaw config set channels.telegram.botToken \"$TELEGRAM_BOT_TOKEN\"" ``` ```bash ssh root@"$DROPLET_IP" "openclaw gateway restart" ``` -------------------------------- ### fetch_with_auth Tool Source: https://agentcash.dev/docs/tools/fetch-with-auth The fetch_with_auth tool is a deprecated compatibility alias for fetch. It uses the same unified flow: probe the route, attempt SIWX (Sign-In With X) when available, and only pay if the route still returns 402. ```APIDOC ## fetch_with_auth > Compatibility alias for fetch. The `fetch_with_auth` tool is a deprecated compatibility alias for [`fetch`](/tools/fetch). It uses the same unified flow: probe the route, attempt SIWX (Sign-In With X) when available, and only pay if the route still returns `402`. Equivalent CLI command: `npx agentcash fetch-auth ` (deprecated alias for `npx agentcash 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. - **headers** (string[]) - Optional - Additional HTTP headers. Each entry must be a string in `Name: value` format. - **timeout** (number) - Optional - Request timeout in milliseconds. ### 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. ### 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. ``` -------------------------------- ### View Gateway Journal Logs Source: https://agentcash.dev/docs/openclaw-setup/for-agents This command retrieves the last 50 lines of the Openclaw gateway journal logs, which can be helpful for diagnosing startup problems. ```bash ssh root@"$DROPLET_IP" 'journalctl -u openclaw --no-pager -n 50' ``` -------------------------------- ### Global Options Source: https://agentcash.dev/docs/cli/overview A list of global options that can be used with any AgentCash CLI command. ```APIDOC ## Global options | Flag | Description | | ------------------- | ----------------------------------------------------------------------- | | `--verbose` / `-v` | Enable debug output to stderr | | `--quiet` / `-q` | Suppress stderr output | | `--format ` | Output format: `json` (default for pipes) or `pretty` (default for TTY) | | `--invite ` | Invite code to redeem for starter credits | | `-y` / `--yes` | Yes to all prompts | | `--dev` | Use development endpoints (localhost) | | `--sessionId ` | Session ID for request tracing (auto-generated if not provided) | | `--provider ` | Custom provider identifier | | `--version` | Show version number | ``` -------------------------------- ### agentcash discover Source: https://agentcash.dev/docs/cli/fetch Lists available endpoints at an API origin with descriptions and authentication modes (paid or SIWX). This command works with any origin, not just registered ones. ```APIDOC ## POST /api/discover ### Description Lists available endpoints at an API origin with descriptions and authentication modes. ### Method POST ### Endpoint /api/discover ### Parameters #### Query Parameters - **url** (string) - Required - The origin URL to discover endpoints from. - **include_guidance** (boolean) - Optional - Return full provider documentation (useful when composing multiple endpoints or when usage is unclear). ### Request Example ```json { "url": "https://stableenrich.dev", "include_guidance": true } ``` ### Response #### Success Response (200) - **endpoints** (array) - A list of discovered endpoints, each with a description and authentication mode. #### Response Example ```json { "endpoints": [ { "path": "/api/apollo/people-enrich", "description": "Enrich people data using Apollo.io", "auth_mode": "paid" } ] } ``` ``` -------------------------------- ### Configure Gateway to Bind to Tailnet Source: https://agentcash.dev/docs/openclaw-setup/for-agents This command configures the Openclaw gateway to bind to Tailnet, allowing access via `http://:18789`. A token is required for authentication. ```bash ssh root@"$DROPLET_IP" 'bash -s' <<'TAILNET' openclaw config set gateway.bind tailnet openclaw gateway restart TAILNET ``` -------------------------------- ### Check a specific endpoint using CLI Source: https://agentcash.dev/docs/guides/discovering-endpoints This command inspects a single endpoint's pricing and schema without initiating a paid call. It returns details like price, supported methods, and input/output schemas. ```bash npx agentcash check https://stableenrich.dev/api/company/lookup ``` -------------------------------- ### Configure AgentCash for Zed Source: https://agentcash.dev/docs/installation/other-clients Add this configuration to your Zed settings to enable AgentCash. ```json { "context_servers": { "agentcash": { "command": { "path": "npx", "args": ["-y", "agentcash@latest"] } } } } ``` -------------------------------- ### Check USDC balance Source: https://agentcash.dev/docs/wallet/networks Retrieve the total USDC balance using the CLI or MCP tool. ```shell npx agentcash balance ``` ```text get_balance ``` -------------------------------- ### Find Process Using a Port Source: https://agentcash.dev/docs/openclaw-setup/for-agents Use `lsof` to identify which process is using a specific port on the droplet. This is useful for resolving 'port already in use' errors. ```bash ssh root@"$DROPLET_IP" 'lsof -i :18789' ``` -------------------------------- ### Add AgentCash Skill URL to Agent Configuration Source: https://agentcash.dev/docs/quickstart Add this URL to your agent's context or configuration to teach it how to discover and use AgentCash premium APIs. This is the simplest way to connect AgentCash to your agent. ```text agentcash.dev/skill.md ``` -------------------------------- ### Fetch Data from Premium Endpoint Source: https://agentcash.dev/docs/guides/calling-apis Use this prompt to ask your agent to fetch data from a premium endpoint. AgentCash handles the payment process automatically. ```text Use AgentCash to fetch https://stableenrich.dev/api/company/lookup with body {"domain": "anthropic.com"}. ``` -------------------------------- ### OpenClaw SSH Commands Quick Reference Source: https://agentcash.dev/docs/openclaw-setup/for-agents Common OpenClaw tasks that can be executed remotely via SSH. Ensure you have the correct IP address and necessary permissions. ```bash ssh root@$IP 'openclaw status' ``` ```bash ssh root@$IP 'openclaw logs --follow' ``` ```bash ssh root@$IP 'openclaw gateway restart' ``` ```bash ssh root@$IP 'npm install -g openclaw@latest' ``` ```bash ssh root@$IP 'openclaw models set ' ``` ```bash ssh root@$IP 'tar -czvf ~/openclaw-backup.tar.gz ~/.openclaw' ``` ```bash ssh root@$IP 'openclaw doctor --non-interactive' ``` -------------------------------- ### Fetch Protected Endpoint via CLI Source: https://agentcash.dev/docs/guides/authentication Use the AgentCash CLI to fetch a protected endpoint. This command handles the SIWX handshake automatically. ```bash npx agentcash fetch https://example.com/api/protected-endpoint ``` -------------------------------- ### Manage SSH Keys on DigitalOcean Source: https://agentcash.dev/docs/openclaw-setup/for-agents Lists existing SSH keys on your DigitalOcean account and imports a local public key if none exist. This key will be used for SSH access to the droplet. ```bash # Check if any keys exist on the account doctl compute ssh-key list ``` ```bash # If none, import your local public key doctl compute ssh-key import openclaw-key --public-key-file ~/.ssh/id_ed25519.pub ``` -------------------------------- ### Increase Node Heap Size Source: https://agentcash.dev/docs/openclaw-setup/for-agents If encountering out-of-memory errors, increase the Node.js heap size using the `NODE_OPTIONS` environment variable before running the Openclaw onboard command. ```bash # Increase Node heap ssh root@"$DROPLET_IP" 'export NODE_OPTIONS="--max-old-space-size=1536" && openclaw onboard --install-daemon' ``` -------------------------------- ### Validate AgentCash Discovery Source: https://agentcash.dev/docs/guides/server-discovery Use these commands to validate your server's OpenAPI document against AgentCash discovery requirements. ```bash npx -y @agentcash/discovery@latest discover "$TARGET_URL" npx -y @agentcash/discovery@latest check "$TARGET_URL" ``` -------------------------------- ### check_endpoint_schema Tool Source: https://agentcash.dev/docs/tools/check-endpoint-schema This tool probes an endpoint to retrieve pricing, authentication requirements, and schema information without incurring any charges. ```APIDOC ## POST /check_endpoint_schema ### Description Probe an endpoint for pricing, auth requirements, and schema without paying. ### 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. ### Request Example ```json { "url": "https://stableenrich.dev/api/company/lookup", "method": "GET", "headers": [ "Accept: application/json" ] } ``` ### 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`. #### Response Example ```json { "price": "0.01 USDC", "methods": ["GET", "POST"], "inputSchema": { "type": "object", "properties": { "companyName": { "type": "string" } } }, "outputSchema": { "type": "object", "properties": { "companyId": { "type": "string" }, "name": { "type": "string" } } }, "authType": "none" } ``` ``` -------------------------------- ### Configure AgentCash for Codex Source: https://agentcash.dev/docs/installation/other-clients Add this configuration to your Codex MCP settings to enable AgentCash. ```json { "mcpServers": { "agentcash": { "command": "npx", "args": ["-y", "agentcash@latest"] } } } ``` -------------------------------- ### Deprecated Fetch Alias Source: https://agentcash.dev/docs/cli/fetch Deprecated alias for `fetch`. New integrations should call `fetch` directly. ```bash npx agentcash fetch-auth [options] ``` -------------------------------- ### agentcash fetch Source: https://agentcash.dev/docs/cli/fetch Sends an HTTP request with automatic SIWX authentication and payment handling. It can automatically handle SIWX authentication and payment if required by the endpoint. If the endpoint returns a 402 status code, AgentCash attempts SIWX first and only pays if the route still requires it. ```APIDOC ## POST /api/fetch ### Description Sends an HTTP request with automatic SIWX authentication and payment handling. ### Method POST ### Endpoint /api/fetch ### Parameters #### Query Parameters - **url** (string) - Required - The URL of the endpoint to fetch. - **method** (string) - Optional - HTTP method (default: GET). - **body** (string) - Optional - Raw request body string, passed through as-is. - **header** (string) - Optional - HTTP header in `Name: value` format (repeatable). - **timeout** (integer) - Optional - Request timeout in milliseconds. - **payment_protocol** (string) - Optional - Force a specific payment protocol: `x402` or `mpp`. - **payment_network** (string) - Optional - Preferred network for SIWX and payment when applicable. - **max_amount** (number) - Optional - Abort if the payment challenge exceeds this amount. ### Request Example ```json { "url": "https://stableenrich.dev/api/apollo/people-enrich", "method": "POST", "body": "{\"email\":\"user@example.com\"}" } ``` ### Response #### Success Response (200) - **body** (string) - The response body from the fetched endpoint. - **headers** (object) - The response headers from the fetched endpoint. - **status_code** (integer) - The status code of the response. #### Response Example ```json { "body": "{\"name\": \"John Doe\"}", "headers": { "Content-Type": "application/json" }, "status_code": 200 } ``` ``` -------------------------------- ### Check and Open SSH Tunnel for Dashboard Access Source: https://agentcash.dev/docs/openclaw-setup/for-agents Before establishing an SSH tunnel, check if the local port is in use. If it is, choose an alternative local port. This command opens a tunnel to access the gateway dashboard. ```bash # Check if port 18789 is free locally lsof -i :18789 2>/dev/null && echo "Port in use — pick another local port or kill the process" || echo "Port free" ``` ```bash # Open the tunnel (use a different local port if 18789 is taken, e.g. -L 18790:localhost:18789) ssh -f -N -L 18789:localhost:18789 root@"$DROPLET_IP" ```