Compute
Decentralized AI inference, priced for builders.
Call open models over a decentralized GPU marketplace. Pay per request with on-chain settlement. OpenAI-compatible API means you keep your existing SDK and swap the base URL.
Try it without code
§ 01 · Quickstart
Recommended
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.
Or follow the 5 steps below to wire it up yourself.
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
# use a provider address from list-providers, e.g. the Qwen 2.5 7B testnet provider:export PROVIDER=0xa48f01287233509FD694a22Bf840225062E678360g-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: 'qwen/qwen-2.5-7b-instruct', // or any model listed on compute-marketplace.0g.aimessages: [{ 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 compute-marketplace.0g.ai
Going deeper
Prefer wallet-based auth inside your app instead of a generated API key? Use the broker SDK directly:
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!' }] }),})
§ 02 · Compute SDKs
§ 03 · Deep dive
§ 04 · Tutorials
§ 05 · 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

