0G Compute
/install 0g-compute
0G Compute Network
Interface with the 0G Compute Network — a decentralized AI inference marketplace with TEE-verified model integrity.
Prerequisites
0g-compute-cliinstalled:npm i -g @0glabs/0g-serving-broker- Note: npm package name is
@0glabs/0g-serving-broker(the old@0glabs/0g-compute-clipackage name no longer resolves), but the binary command is still0g-compute-cli.
- Note: npm package name is
- Wallet funded with 0G tokens
- Logged in: avoid passing key on the command line when possible (it can be visible in shell history/process list). Prefer reading from a protected prompt/env:
read -s OG_PK; 0g-compute-cli login --private-key "$OG_PK"; unset OG_PK
- Network configured:
0g-compute-cli setup-network
Core Workflows
1. Discover Models
# List all providers with models, prices, verifiability
0g-compute-cli inference list-providers
# Detailed view with health/uptime metrics
0g-compute-cli inference list-providers-detail
# Include providers without valid TEE signer
0g-compute-cli inference list-providers --include-invalid
Filter output by model name, price, health status, and TeeML support (models running in Trusted Execution Environment).
2. Verify Provider Integrity
Always verify before trusting a new provider. TEE verification ensures the model runs in a secure enclave with hardware-attested integrity.
# Full TEE attestation check
0g-compute-cli inference verify --provider \x3Caddress>
# Download raw attestation data
0g-compute-cli inference download-report --provider \x3Caddress> --output report.json
The verify command checks:
- TEE signer address matches contract
- Docker Compose hash integrity
- DStack TEE (Intel TDX) attestation
3. Wallet & Balance
# Account overview
0g-compute-cli get-account
# Per-provider sub-account balance
0g-compute-cli get-sub-account --provider \x3Caddress> --service inference
# Fund operations
0g-compute-cli deposit --amount \x3C0G> # To main account
0g-compute-cli transfer-fund --provider \x3Caddr> --amount \x3C0G> --service inference # To sub-account
0g-compute-cli retrieve-fund --service inference # From sub-accounts
0g-compute-cli refund --amount \x3C0G> # Withdraw to wallet
Important: Inference calls fail if sub-account balance is depleted. Monitor balances regularly.
4. Configure OpenClaw Provider
Get API key from a verified provider (interactive — prompts for expiration):
0g-compute-cli inference get-secret --provider \x3Caddress>
Add to openclaw.json:
"providers": {
"0g-\x3Cmodel-name>": {
"baseUrl": "\x3Cprovider-url>/v1/proxy",
"apiKey": "\x3Csecret>",
"api": "openai-completions",
"models": [{ "id": "\x3Cmodel-id>", "name": "\x3Cdisplay-name>" }]
}
}
Register in agents.defaults.models with an alias. Set cost: 0 since billing is on-chain.
See references/openclaw-config.md for complete setup guide.
5. Price Comparison (0G vs OpenRouter)
Compare 0G pricing against OpenRouter for the same models:
scripts/0g-price-compare.sh
No API keys needed — uses public endpoints:
- CoinGecko for 0G token → USD price
- OpenRouter
/api/v1/modelsfor model pricing - 0G CLI for provider pricing
Shows side-by-side USD/1M tokens with savings percentage. Set OG_TOKEN_PRICE_USD env var to override CoinGecko price.
6. Status Check
# Login status & wallet
0g-compute-cli status
# Current network (mainnet/testnet)
0g-compute-cli show-network
Safety Guidelines
- Always run
inference verifyon new providers before use - Check provider health/uptime before relying on them
- Monitor sub-account balances — depleted funds cause inference failures
- Private key stored in
~/.0g-compute-cli/config.json— never expose this file
Reference Documentation
- CLI Reference — Complete command reference with all flags and examples
- OpenClaw Config — Step-by-step provider setup guide
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install 0g-compute - After installation, invoke the skill by name or use
/0g-compute - Provide required inputs per the skill's parameter spec and get structured output
What is 0G Compute?
Use cheap, TEE-verified AI models from the 0G Compute Network as OpenClaw providers. Discover available models and compare pricing vs OpenRouter, verify prov... It is an AI Agent Skill for Claude Code / OpenClaw, with 943 downloads so far.
How do I install 0G Compute?
Run "/install 0g-compute" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is 0G Compute free?
Yes, 0G Compute is completely free (open-source). You can download, install and use it at no cost.
Which platforms does 0G Compute support?
0G Compute is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created 0G Compute?
It is built and maintained by in-liberty420 (@in-liberty420); the current version is v1.0.2.