Back to API Docs

0G Compute Network

Access 0G's decentralized, TEE-backed AI models through the Cluster Protocol unified API

18
0G Models
Chat, vision, audio & image
TEE
Verifiable Compute
Attested decentralized providers
On-chain
Settlement
Every call metered on 0G

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.

bash
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.

POST/v1/chat/completions
bash
curl -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.

json
{
  "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.

bash
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.

bash
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.

Chat11 models
0gm-1.0-35b-a3b0gm-1.0-35b-a3b-siaglm-5glm-5.1glm-5.2deepseek-v4-flashdeepseek-v4-prominimax-m3qwen3.6-plusqwen3.7-plusqwen3.7-max
Code1 models
kimi-k2.7-code
Vision1 models
qwen3-vl-30b
Audio1 models
whisper-large-v3
Image1 models
z-image-turbo

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

StatusMeaningAction
400Bad RequestCheck model ID and parameters
401UnauthorizedVerify your API key
402Payment RequiredComplete x402 payment or add funds
429Rate LimitedBack off and retry
503Model Unavailable0G provider temporarily offline; retry or try another