Compute
Decentralized AI inference, priced for builders.
Call open models over a decentralized GPU marketplace. Open provider bidding sets the price, you pay per request, and settlement happens on chain.
§ 01 · Start here: Private Computer
Primary path
Private Computer is the fastest way onto 0G Compute. One API key gets you the whole model catalog: chat, image, speech, and embeddings, through an OpenAI-compatible endpoint, so you change a base URL and keep your existing SDK. Open provider bidding sets the price, and there are no platform or top-up fees. Every request is verifiably routed, and you can dial privacy up per request when the workload needs it.
Get an API keyGet an API key
Sign in and create a key. One key covers every model in the catalog.
pc.0g.aiModel catalog
Live list of models with per-model pricing and the trust modes each one supports.
pc.0g.ai/modelsPlayground
Try a model in the browser before you write any code.
pc.0g.ai/playgroundNetwork stats
Live request, token, and TEE-proof counters.
pc.0g.ai/stats§ 02 · Advanced: wallet auth with the broker
Prefer wallet-based auth inside your app instead of a hosted API key? Talk to the 0G Compute broker directly. You hold the key, you pick the provider, and every request settles on chain from your own ledger.
Reference implementation
Start from the Compute TypeScript Starter Kit
End-to-end example showing account setup, provider acknowledgement, and inference calls. Clone, set a private key, and run.
Follow the 5 steps below to wire it up yourself.
The deposit in step 02 spends a real balance, and step 03 needs compute credit. If you have neither, start at Get funded.
Install the CLI and OpenAI SDK
# Node 20+ requiredpnpm add @0gfoundation/0g-compute-ts-sdk -gnpm install openai
Provision an account
# set PRIVATE_KEY in your shell env first (testnet wallet funded via faucet.0g.ai)0g-compute-cli setup-network0g-compute-cli login0g-compute-cli deposit --amount 3 # 3 OG minimum to create the ledger0g-compute-cli inference list-providers # note a provider address to use
Transfer funds and generate an API key
# copy a provider address from the list-providers output in step 02export PROVIDER=<address-from-list-providers>0g-compute-cli transfer-fund --provider $PROVIDER --amount 10g-compute-cli inference acknowledge-provider --provider $PROVIDER0g-compute-cli inference get-secret --provider $PROVIDER# prints an app-sk-... secret and the service URL, copy both
Call a model with the OpenAI SDK
import OpenAI from 'openai'const client = new OpenAI({baseURL: `${process.env.ZG_SERVICE_URL}/v1/proxy`,apiKey: process.env.ZG_API_SECRET, // the app-sk-... from step 03})const completion = await client.chat.completions.create({model: '0GM-1.0-35B-A3B', // or any model listed on pc.0g.ai/modelsmessages: [{ role: 'user', content: 'Hello, frontier.' }],})console.log(completion.choices[0].message.content)
Check your balance
0g-compute-cli get-account# or view the dashboard at pc.0g.ai
CLI or SDK
The CLI wraps the broker SDK. To do the same from inside your app:
import { ethers } from 'ethers'import { createZGComputeNetworkBroker } from '@0gfoundation/0g-compute-ts-sdk'const provider = new ethers.JsonRpcProvider('https://evmrpc-testnet.0g.ai')const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider)const broker = await createZGComputeNetworkBroker(wallet)const { endpoint, model } = await broker.inference.getServiceMetadata(PROVIDER_ADDRESS)const headers = await broker.inference.getRequestHeaders(PROVIDER_ADDRESS)const res = await fetch(`${endpoint}/chat/completions`, {method: 'POST',headers: { 'Content-Type': 'application/json', ...headers },body: JSON.stringify({ model, messages: [{ role: 'user', content: 'Hello!' }] }),})
Settlement transactions and provider activity are visible on Chain Scan.
§ 03 · Trust modes
Not every task needs the same guarantee. Standard is the default and has the widest coverage, so step up only when the workload calls for it.
Standard
DefaultWidest coverage: every model and provider including community channels. Routing is not attested.
Everyday tasks, best price and availability
Verified
Routing restricted to attested providers. You get a signed proof that the model you called is the model that ran, no silent substitution.
You need provenance
Private
TEE-isolated execution path. Neither 0G nor the provider sees the prompt.
Sensitive data
How to set it
Per request
Send a header with the call. It overrides the key default for that request only.
X-0G-Provider-Trust-Mode: verified|privatePer key default
Set a default for a whole key in the PC Dashboard: API Key, then Edit.
What the attestation actually proves
TeeML
The model runs inside the enclave. Hardware baseline is an Intel TDX CPU plus an NVIDIA H100/H200 with TEE support. The prompt enters the enclave encrypted, the output is signed inside the enclave before it leaves, and the host machine only ever sees encrypted traffic.
Verified and Private
TeeTLS
The routing path, not the execution. A Broker running inside a TEE proxies the request to the provider over HTTPS, pins the provider's TLS certificate during the handshake, then signs a routing proof bundling the cert fingerprint, request hash, response hash and provider identity. Conceptually close to zkTLS with stronger privacy, since the TEE guarantees the relay itself is trustworthy.
Verified only: inference still happens at the upstream provider, which can see the prompt
SPML
For open-source models that are neither self-hosted in a 0G enclave nor served from a closed-source official channel: verifies the provider's GPU and model deployment.
Verified
Fine print
- Most models are not running inside a TEE. Only a minority of providers are TeeML; most are TeeTLS, which attests the routing path and not the execution.
- Standard is not the absence of a guarantee. If a model is served only by TeeML providers, your requests run inside an enclave whichever mode you pick.
§ 04 · Compute SDKs
§ 05 · Deep dive
§ 06 · Tutorials
§ 07 · Built with Compute
View showcase →Shawarma Orchestrate
Multi-agent AI prediction platform where specialized agents collaborate via 0G Compute to research questions, reach consensus, and execute on-chain Uniswap trades.
ETHGlobal Cannes 2026Alpha Dawg
Autonomous multi-agent swarm that hires specialists via nanopayments, runs TEE-sealed adversarial debate on 0G Compute, and stores a verifiable cycle DAG on 0G Storage.
ETHGlobal Cannes 2026Don't Get Drained
Agentic firewall marketplace where security researchers publish AI guard agents on 0G that review DeFi transactions before execution using 0G Compute and 0G Storage.
ETHGlobal Cannes 2026Croisette.cc
Agentic investment platform using ZeroClaw agents with 0G Compute LLMs for 24/7 portfolio building and management, with prompt integrity verified on 0G Storage.
ETHGlobal Cannes 2026Orchestra
Conversational AI agent for crypto swaps and transfers, using 0G Compute for inference and 0G Storage for agent memory, with Ledger hardware approval for high-value transactions.
ETHGlobal Cannes 2026CaaS
Claw-as-a-Service platform for deploying World ID-verified autonomous AI agents as ERC-7857 Agentic IDs on 0G Chain with 0G Storage memory and WLD-powered x402 micropayments.
ETHGlobal Cannes 2026

