0G Compute Network
Access 0G's decentralized, TEE-backed AI models through the Cluster Protocol unified API
Quick Start
0G Compute Network is a decentralized inference layer where every request is served by TEE-attested providers and settled on-chain. It is fully OpenAI-compatible through Cluster — change the base URL and go.
curl -X POST https://api.clusterprotocol.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "0gm-1.0-35b-a3b",
"provider": "zerog",
"messages": [{"role": "user", "content": "Hello from 0G!"}]
}'Omit provider to let Cluster route the model automatically; set it to zerog to pin every call to the 0G network.
Authentication
Use an API key for standard access, or x402 for permissionless, pay-per-request access with USDC on Base — no pre-registration required.
Authorization: Bearer YOUR_API_KEY
Chat Completions
Generate text with 0G chat models (GLM-5.x, DeepSeek V4, Qwen3.7, MiniMax M3, 0GM, Claude). Note: reasoning models (GLM-5.2, MiniMax M3) spend tokens on internal reasoning — use a higher max_tokens (300+) to see final content.
/v1/chat/completionscurl -X POST https://api.clusterprotocol.ai/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "glm-5.2", "provider": "zerog", "messages": [{"role": "user", "content": "Explain zero-knowledge proofs"}], "max_tokens": 500}'Vision
Send images to 0G vision models (qwen3-vl-30b) using the standard OpenAI multimodal content format.
{
"model": "qwen3-vl-30b",
"provider": "zerog",
"messages": [
{ "role": "user", "content": [
{ "type": "text", "text": "What is in this image?" },
{ "type": "image_url", "image_url": { "url": "https://..." } }
]}
]
}Transcription
Transcribe audio with whisper-large-v3 served by 0G. Multipart form upload, OpenAI-compatible.
curl -X POST https://api.clusterprotocol.ai/v1/audio/transcriptions \ -H "Authorization: Bearer YOUR_API_KEY" \ -F file=@audio.mp3 \ -F model=whisper-large-v3 \ -F provider=zerog
Image Generation
Generate images with 0G's z-image-turbo model.
curl -X POST https://api.clusterprotocol.ai/v1/images/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "z-image-turbo", "provider": "zerog", "prompt": "A neon-lit cyberpunk city", "size": "1024x1024"}'Model Catalog
All 18 0G Compute Network models available through Cluster. Set model to any ID below.
x402 Payment Integration
Access 0G models permissionlessly via x402 — send a request without an API key, receive HTTP 402 with USDC payment details, pay on Base (chain 8453), and re-submit with proof. Under the hood, Cluster settles the inference cost with the 0G network on-chain.
Error Handling
| Status | Meaning | Action |
|---|---|---|
| 400 | Bad Request | Check model ID and parameters |
| 401 | Unauthorized | Verify your API key |
| 402 | Payment Required | Complete x402 payment or add funds |
| 429 | Rate Limited | Back off and retry |
| 503 | Model Unavailable | 0G provider temporarily offline; retry or try another |