x402 Compute Skill
Thex402-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, 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 samex402c_…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
sglCLI, register, attest, and serve a model to earn USDC + SGL. See Provide Compute and the skill’sreferences/node-operator.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.6.0 — adds SGL Grid (OpenAI-compatible confidential inference) and a Provide Compute / run-a-node module on top of Machines. x402 Base/Solana/MegaETH payments are live. Pre-loaded USD credits available for payment-free provisioning, extending, and Grid inference. MegaETH uses USDm (ERC-2612 permit) 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:- Signature auth headers (
X-Auth-*) - API key (
X-API-Key)
- direct Base, Solana, or MegaETH signing keys
- optional OpenWallet / OWS for auth + API-key creation + management
- Create API key once via
POST /compute/api-keysusing direct signing keys or OWS-backed auth. - Store key in
COMPUTE_API_KEY. - Use API key for routine list/details/resize/destroy/password fallback calls.
Resize model
POST /compute/instances/:id/resizeis a management action, not a second payment flow.- The API preserves the instance’s remaining prepaid dollar credit and recalculates
expires_atfor 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: truebecause 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/topupwith{ "amount": 50, "network": "base" }. Omit theX-Paymentheader to receive a 402 challenge, then pay and retry. Supports all networks: base, solana, megaeth. - Check balance:
GET /compute/credits/balancewith auth headers or API key. - Use credits: Pass
"use_credits": truein 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
| Method | Endpoint | Purpose |
|---|---|---|
GET | /compute/plans | List VPS/GPU plans |
GET | /compute/regions | List deployment regions |
GET | /compute/os | List OS images |
POST | /compute/provision | Provision Vultr or DigitalOcean instance (x402 or MPP payment) |
GET | /compute/instances | List instances for authenticated wallet |
GET | /compute/instances/:id | Get instance details |
POST | /compute/instances/:id/password | One-time root password fallback |
POST | /compute/instances/:id/extend | Extend prepaid duration (x402 or MPP payment + auth) |
POST | /compute/instances/:id/resize | Resize an instance in place and recalculate remaining prepaid time |
DELETE | /compute/instances/:id | Destroy instance |
GET | /compute/credits/balance | Get credit balance for authenticated wallet |
POST | /compute/credits/topup | Top up credits via x402 payment |
POST | /compute/api-keys | Create API key (signature only) |
GET | /compute/api-keys | List API keys |
DELETE | /compute/api-keys/:id | Revoke API key |
Install Skill
skills.sh (portable — Cursor, Claude Code, Codex, Gemini, and more)
ivaavimusic/singularity-skill repo, which hosts both --skill singularity (marketplace/payments) and --skill x402-compute (Cloud Network compute).
Hosted one-liner
api.x402layer.cc) — always pulls the latest version.
ClawHub / OpenClaw
https://clawhub.ai/ivaavimusic/x402-compute
Scripts Included
| Script | Purpose |
|---|---|
browse_plans.py | Browse plans and pricing |
browse_regions.py | Browse regions |
provision.py | Provision a compute instance |
create_api_key.py | Create reusable API key |
list_instances.py | List instances |
instance_details.py | Get detailed status |
get_one_time_password.py | Fetch one-time root password fallback |
extend_instance.py | Extend instance duration |
resize_instance.py | Resize an instance in place |
destroy_instance.py | Destroy instance |
ows_cli.py | Run OpenWallet / OWS wallet, sign-message, and key commands |
Quick Workflow
1) Provision with SSH Key (Recommended)
1b) Provision with MPP / mppx
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
4) One-Time Password Fallback (Only if no SSH key)
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, or MegaETH payment-signing paths
- MPP provision and extend use
mppx, Tempo Wallet, or another MPP-capable client
Payment options
| Option | Status | Notes |
|---|---|---|
| x402 Base USDC | Live | Existing UI/script flow |
| x402 Solana USDC | Live | Existing script flow |
| x402 MegaETH USDm | Live | ERC-2612 permit flow; embedded facilitator; gasless for users |
| MPP Tempo USDC.e | Live | Tested with npx mppx; returns Payment-Receipt |
| Credits | Live | Pre-load USD via x402 topup; provision/extend with use_credits: true |
| MPP Stripe cards | Pending | Requires Stripe Machine Payments / Shared Payment Token access |
Compute providers
| Provider | Status | Notes |
|---|---|---|
| Vultr | Live | One-time password fallback available; resize is upgrade-only |
| DigitalOcean | Code-ready | Requires DIGITALOCEAN_API_TOKEN; SSH key required; disk growth is irreversible |
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
