Skip to main content

0G Compute Router

The 0G Compute Router is an API gateway that sits in front of the entire 0G Compute Network. One endpoint, one API key, every model.

It handles provider discovery, on-chain billing, authentication, and failover automatically — so you use 0G's decentralized inference with the same code you'd write for OpenAI or Anthropic.

When to Use the Router

RouterDirect
SetupGet an API keyInstall SDK, manage wallet keys
Provider managementAutomatic routing + failoverManual selection & funding
BillingSingle unified on-chain balancePer-provider sub-accounts
API shapeOpenAI / Anthropic compatibleCustom SDK calls
Best forServer-side apps, agents, prototypesBrowser dApps, direct chain access

Pick the Router when you want the simplest integration path. Pick Direct when you need per-provider control or wallet-signed requests in the browser.

60-Second Tour

Quickstart → Connect wallet, deposit, create an API key, send your first request — in four steps.

Chat Completions → OpenAI-compatible /v1/chat/completions with streaming, tool calling, and reasoning tokens.

Provider Routing → Route by lowest latency, lowest price, or pin to a specific on-chain provider.

Authentication → API keys with three permission tiers.

Models → Browse the live catalog. Each model has pricing, context window, and capability flags.

Deposits & Billing → Deposit 0G tokens, consume on-chain, settle periodically. No subscriptions.

Base URLs

Mainnet and testnet are fully separate environments — different Web UI, different API endpoint, different on-chain balances and API keys. Pick the one that matches the network your wallet is on.

NetworkWeb UIAPI Endpoint
Mainnetpc.0g.aihttps://router-api.0g.ai/v1
Testnetpc.testnet.0g.aihttps://router-api-testnet.integratenetwork.work/v1
OpenAI SDK drop-in

Any tool that speaks the OpenAI API works with 0G Router — change base_url and api_key, nothing else.

Migrating from compute-marketplace.0g.ai?

If you previously deposited on compute-marketplace.0g.ai, those funds live in per-provider sub-accounts under the Direct flow. They do not appear in the Router balance on pc.0g.ai — the two systems use different contracts and different accounting.

To see and use those old funds on pc.0g.ai, switch to Advanced mode using the toggle in the top-right. Advanced mode is the same Direct flow, just embedded in the new UI. See Router vs Advanced Mode.