Skip to main content

x402 Compute Skill

The x402-compute skill is the agentic interface to the Singularity Cloud Network. It covers three jobs:
  • SGL Machines — provision and manage VPS/GPU instances on Vultr or DigitalOcean (x402 on Base/Solana/MegaETH/Robinhood Chain, MPP via mppx, or pre-loaded USD credits; OWS auth, API keys, in-place resize).
  • SGL Grid — inference — call decentralized, confidential (TEE), OpenAI-compatible inference (https://grid.x402compute.cc/v1) with the same x402c_… API key/credits or per-request x402; supports token streaming + end-to-end encryption.
  • Provide Compute (run a node) — turn a TEE-capable machine into a grid node: stake $SGL, install the sgl CLI, register, attest, and serve a model to earn USDC + SGL. See Provide Compute and the skill’s references/node-operator.md.
  • Agent Pods — deploy an always-on hosted OpenClaw agent with its own crypto wallet, memory, scheduler, and preinstalled x402 skills; managed or BYOK. See Agent Pods and the skill’s references/agent-pods.md.
  • Processors — publish your own code as a paid endpoint. Buyers pay you directly in USDC over x402; you pay only for the runtime you use. Every processor is also a connectable MCP server, so agents, harnesses, and LangGraph nodes can call it with just a URL. See Processors and the skill’s references/processors.md.
Primary access method is SSH public key. If no SSH key was provided during provisioning, a one-time password fallback endpoint is available.
Current release: v1.13.0.Security — action may be required. As of v1.13.0 the skill’s scripts no longer read .env files. Credentials come only from environment variables you have exported. If you kept your keys in a .env, source it yourself before running the skill, or you will see Set SOLANA_SECRET_KEY / Set PRIVATE_KEY. Previously load_dotenv() searched upward from the script’s own directory, so a .env in the project you installed the skill into — or any parent of it — could supply the credentials used to sign transactions. In the same release OWS_BIN must be an absolute path to an existing, executable, non-world-writable file, and the unpinned npx -y @open-wallet-standard/core fallback was removed: install @open-wallet-standard/[email protected] explicitly instead.Also since v1.10.0: Agent Pods (one-click hosted OpenClaw agents with their own wallet, an OpenAI-compatible adapter, and curated templates) and Processors (publish your own code as a paid endpoint; buyers pay you directly in USDC over x402 and every processor is a connectable MCP server). x402 Base/Solana/MegaETH/Robinhood payments are live. Pre-loaded USD credits available for payment-free provisioning, extending, and Grid inference. MegaETH uses USDm (ERC-2612 permit) and Robinhood Chain uses USDG (EIP-3009 transferWithAuthorization), both with an embedded facilitator — gasless for users. MPP Tempo USDC.e payments are also live for agent/CLI provisioning.
DigitalOcean is available as an additional compute provider when configured. DigitalOcean plans are prefixed with do: and require SSH key access because DigitalOcean does not expose one-time root passwords through its API.

Base URL

https://compute.x402layer.cc

Auth Model

Management endpoints require one of:
  1. Signature auth headers (X-Auth-*)
  2. API key (X-API-Key)
Supported auth approaches today:
  • direct Base, Solana, MegaETH, or Robinhood Chain signing keys
  • optional OpenWallet / OWS for auth + API-key creation + management
Recommended agent flow:
  1. Create API key once via POST /compute/api-keys using direct signing keys or OWS-backed auth.
  2. Store key in COMPUTE_API_KEY.
  3. Use API key for routine list/details/resize/destroy/password fallback calls.

Resize model

  • POST /compute/instances/:id/resize is a management action, not a second payment flow.
  • The API preserves the instance’s remaining prepaid dollar credit and recalculates expires_at for the target hourly rate.
  • Resize stays on the current provider and current region. The backend validates family/spec compatibility before it forwards the provider API call.
  • Vultr resizes are upgrade-only.
  • DigitalOcean can increase disk size, but disk-growing resizes require confirm_disk_resize: true because the disk change is irreversible.
  • Expect downtime during resize. Take a snapshot/backup first.

Credits

Pre-load USD credits to your wallet via a one-time x402 payment, then provision and extend instances without a live blockchain payment each time. Credits are ideal for API-key-driven automation where you want to avoid per-operation payment flows.
  • Top up: POST /compute/credits/topup with { "amount": 50, "network": "base" }. Omit the X-Payment header to receive a 402 challenge, then pay and retry. Supports all networks: base, solana, megaeth, robinhood.
  • Check balance: GET /compute/credits/balance with auth headers or API key.
  • Use credits: Pass "use_credits": true in the provision or extend request body. The server deducts from your credit balance instead of requiring x402/MPP payment.
  • Auto-refund: If the cloud provider rejects the instance after credits are deducted, the full amount is automatically refunded to your balance.
Credits are scoped per wallet. One credit pool covers all operations (provision + extend) across all providers and regions.

Endpoint Summary

Install Skill

skills.sh (portable — Cursor, Claude Code, Codex, Gemini, and more)

Distributed from the ivaavimusic/singularity-skill repo, which hosts both --skill singularity (marketplace/payments) and --skill x402-compute (Cloud Network compute).

Hosted one-liner

Served by the compute skill handler in the gateway (api.x402layer.cc) — always pulls the latest version.

ClawHub / OpenClaw

ClawHub listing: https://clawhub.ai/ivaavimusic/x402-compute

Scripts Included

Quick Workflow

1b) Provision with MPP / mppx

If the MPP provision does not include wallet/API-key auth, the response includes a one-time management_api_key. Store it and use it for later instance management. DigitalOcean example:

1c) Provision with Credits

2) Create API Key for Agents

2b) Optional OpenWallet / OWS auth path

3) Manage Instances

MPP-paid extension requires compute auth:
Resize uses the same management auth, but does not require x402 or MPP payment:
DigitalOcean disk growth example:

4) One-Time Password Fallback (Only if no SSH key)

This works once per instance. Repeated calls return 409.

OWS scope note

  • OWS is great for compute auth and management/API-key flows
  • Direct x402 provision and extend still use the current Base, Solana, MegaETH, or Robinhood Chain payment-signing paths
  • MPP provision and extend use mppx, Tempo Wallet, or another MPP-capable client

Payment options

Compute providers

Security Notes

  • Wallet/agent can only access its own instances.
  • Replay protection uses signed nonce + timestamp.
  • MPP replay protection uses a shared Cloudflare Durable Object replay store.
  • Payment wallet must match authenticated wallet.
  • Resize preserves remaining prepaid value by changing expiry instead of charging a second payment.
  • Passwords are not returned in standard list/details/provision responses.
  • One-time password endpoint is owner-authenticated and single-use.
  • Credit deduction uses PostgreSQL row-level locking to prevent double-spend under concurrent requests.
  • Failed provider calls trigger automatic credit refund before the error response is returned.

References

  • Skill definition: skills/x402-compute/SKILL.md
  • Skill API reference: skills/x402-compute/references/api-reference.md
  • OWS reference: skills/x402-compute/references/openwallet-ows.md
  • Hosted installer: https://api.x402layer.cc/skill/x402-compute/install