No API keys. No subscriptions. Just pay and call.
Axiom is a full-stack, cross-platform AI gateway built on the 0G Compute Network and the x402 Protocol. It eliminates the traditional SaaS subscription model for AI inference by replacing it with cryptographically-verified, per-request micropayments settled on-chain. Every inference call is authorized by an EIP-712 typed-data signature from the user's wallet—no accounts, no billing portals, no rate limits.
Live App: https://axiom-0g.expo.app/
Axiom utilizes a sophisticated, multi-layered architecture designed for decentralization, scalability, and high-performance AI inference.
- Edge-Native Micro-services: Built with Hono, an ultralight framework that allows the Axiom node to operate with minimal overhead in serverless environments like Cloudflare Workers or Vercel Edge.
- Event-Driven Payment-to-Inference Flow: Integration of the x402 Protocol creates a reactive pattern where requests are paused at the middleware layer until a cryptographic payment proof is provided.
- Stateless Agent Execution: Each inference turn is an independent operation, with session state managed via the client-server chat history, enhancing horizontal scalability.
- Layered Security Model: Security is enforced through EIP-712 signature verification for payments and 0G-specific cryptographic headers for inference integrity.
sequenceDiagram
participant User
participant App as Axiom App (Frontend)
participant Server as Axiom Node (Server)
participant 0G as 0G Network (Inference)
User->>App: Submits message & selects tier
App->>Server: Request AI Inference
Server-->>App: HTTP 402: Payment Required (x402)
App->>User: Prompts MetaMask (EIP-712 Sign)
User->>App: Signs payment authorization
App->>Server: Re-submit request + payment proof
Server->>0G: Authorize & execute inference
0G-->>Server: LLM Response + Proof of Execution
Server-->>App: Final response + Receipt
App->>User: Renders message & payment badge
You can experience the complete autonomous economy directly in your browser. No complicated local setup or private key management is required. The entire application runs smoothly on the Base Sepolia testnet.
👉 Launch DApp: https://axiom-0g.expo.app/
When you first open the web application, you are greeted by the Axiom chat interface. Because Axiom is an entirely zero-account ecosystem, there are no signup screens, usernames, or passwords. Your identity and session are intrinsically tied to your wallet, immediately establishing a seamless connection to our AI models. First, connect your wallet.
If you are visiting for the first time and your wallet lacks the necessary USDC for micro-payments, the platform will automatically detect your balance and prompt you to utilize the integrated Axiom Faucet.
- Locate the "Get Testnet USDC" or "Get USDC Drop" button dynamically rendered in the UI (this button gracefully disappears once your wallet is funded).
- Click the button to request your drop.
- What happens under the hood: The request hits our public faucet endpoint where the Axiom Node triggers a transfer from its faucet wallet. It then signs a live transaction and sends 0.1 USDC (Base Sepolia) directly to your address. This is performed entirely securely server-side.
- Your balance inside the application instantly reflects the drop. You are now fueled to begin the AI economy!
Axiom operates an intelligent tiered AI agent system. You have granular control over your queries, and can select between different complexity modes—each strictly backed by a micro-transaction proportionate to the compute used:
- Basic Mode ($0.0001): Ideal for quick answers, powered by lightweight models like
gpt-5.4-mini. - Advanced Mode ($0.001): For deep reasoning and analysis using
Qwen. - Expert Mode ($0.01): For complex tasks and deep analysis using
DeepSeek. - Enhanced Requests with Tools: The agent can access specialized tools (DuckDuckGo, Yahoo Finance, Weather) for an additional cost (e.g., $0.0003 - $0.02 depending on the tier).
- Type a question into the chat (e.g., "What is the current BTC price?" or "Search the web for the latest 0G network news").
- Select whether to enable Tools (Search, Finance, Weather) via the interface options.
- Hit Send.
When you send a prompt, your request encounters the x402 Payment Required protocol. Axiom uses a decentralized gateway rather than traditional web guards:
- Pre-flight & Rejection: The
/api/protectedendpoints intercept your request. Before executing inference, the server replies with anHTTP 402 Payment Requiredstatus, detailing the specific cost in USDC along with atraceId. - Transaction Signing: Your local application client handles this standard gracefully, prompting an EIP-712 Permit signature on Base Sepolia matching the explicit requested parameters.
- Execution Unlocked: The micro-transaction authorization is verified. Your payload is automatically re-submitted with cryptographic proof, the endpoint unlocks, and the 0G Compute Provider processes your prompt.
After the payment authorization settles, the AI agent's reasoning streams directly into your chat interface. You can transparently trace the exact Base Sepolia micropayments. The Axiom economy is therefore self-sustained natively on-chain without any opaque centralized accounting!
Axiom provides a dedicated administrative dashboard for real-time monitoring of your 0G network accounts. This allows you to track exactly how many credits are allocated to different AI models and monitor your native A0GI gas balance.
- A0GI Native Balance: Displays the raw gas tokens held in the server wallet on the 0G Chain (needed for transaction settlement).
- Protocol Ledger:
- Total: The gross balance deposited into the 0G serving broker.
- Locked: Credits currently reserved in active sub-accounts for specific providers.
- Available: Liquidity ready to be allocated to new model tiers or used for top-ups.
- Model Sub-Accounts: A granular breakdown of every active inference account.
- Tier Mapping: Automatically categorizes providers into BASIC, ADVANCED, or EXPERT based on the served model.
- Token Range Logic: Dynamically calculates the estimated remaining Input/Output tokens based on the sub-account balance and the provider's real-time pricing.
- Provider Transparency: Displays the exact 0G provider address for every model, ensuring a fully decentralized and auditable compute chain.
The 0G (Zero Gravity) Compute Network is a decentralized AI compute marketplace. Model providers stake resources and serve inference over a permissionless network. Instead of paying a centralized company like OpenAI, you pay individual compute providers directly through cryptographic micro-transactions.
The core integration point is @0glabs/0g-serving-broker — a TypeScript SDK that abstracts the protocol complexity of service discovery, account management, and request signing on the 0G network.
src/core/ZeroGAgent.js is Axiom's custom lean inference engine, built without LangChain to be compatible with edge runtimes (Cloudflare Workers, Expo API Routes):
// 1. Initialize an ethers.js wallet on the 0G chain (chainId: 16661)
this.wallet = new ethers.Wallet(this.privateKey, this.provider);
// 2. Create the broker — this handles all on-chain account settlement
this.broker = await createZGComputeNetworkBroker(this.wallet);
// 3. Service Discovery — find a live provider for the requested model
const services = await this.broker.inference.listService();
const service = services.find(s => s.model === modelName);
// 4. Resolve the provider's inference endpoint
const { endpoint } = await this.broker.inference.getServiceMetadata(service.provider);
// 5. For each request, get a cryptographic header that authorizes the call
const headers = await this.broker.inference.requestProcessor.getHeader(this.currentProvider);
// 6. Call the provider's OpenAI-compatible endpoint directly
await fetch(`${endpoint}/chat/completions`, {
method: "POST",
headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify({ model, messages, tools, ... })
});The broker's requestProcessor.getHeader() generates a signed proof for each call. The provider validates this signature on-chain before executing inference. Cost is deducted automatically from a pre-funded ledger account associated with the server wallet.
src/core/0g-registry.js implements several advanced optimization strategies to eliminate the latency typically associated with decentralized systems:
- Singleton Broker & Cache Management: Maintains a server-side singleton cache of initialized
ZeroGAgentinstances. Subsequent requests reuse the cached agent, eliminating broker initialization overhead on the hot path. - Service Pre-warming: Proactively initializes connections to the 0G network upon server startup, ensuring that the first user request is handled with zero initialization delay.
- Lean Runtime (No LangChain): Optimized for edge runtimes by removing heavy framework dependencies, using direct fetch calls and streamlined message builders to reduce memory footprint.
Each tier maps to a specific 0G-hosted model and a USDC price enforced by the x402 middleware:
| Tier | Model | Base Price | With Tools |
|---|---|---|---|
| Basic (Fast) | openai/gpt-5.4-mini |
$0.0001 | $0.0003 |
| Advance (Smart) | qwen3.6-plus |
$0.001 | $0.002 |
| Expert (Powerful) | deepseek/deepseek-chat-v3-0324 |
$0.01 | $0.02 |
These are real 0G compute providers serving live models on the network. Axiom's server wallet pre-funds a ledger account via the broker; costs are charged per request.
The x402 Protocol extends HTTP with a payment layer. A server responds with HTTP 402 Payment Required and a description of what it wants. The client signs a payment authorization and retries. The server verifies the signature via a trusted facilitator before serving the response.
src/api/protected/middleware/x402.js is a Hono middleware factory:
// Called on every POST to /api/protected/{tier}
export const requirePayment = (baseAmount, toolAmount, token, network) => {
return async (c, next) => {
const paymentSignature = c.req.header('PAYMENT-SIGNATURE');
const activeAmount = toolsEnabled ? toolAmount : baseAmount;
// No signature → issue a 402 challenge with Base64-encoded requirements
if (!paymentSignature) {
const encodedReq = Buffer.from(JSON.stringify(requirements)).toString('base64');
c.header('PAYMENT-REQUIRED', encodedReq);
return c.json(requirements, 402);
}
// Signature present → decode and verify cryptographically with the facilitator
const decodedSig = JSON.parse(Buffer.from(paymentSignature, 'base64').toString('utf8'));
const isValid = await facilitatorClient.verify(decodedSig, requirements.accepts[0]);
if (!isValid) return c.json({ error: "Invalid payment signature." }, 401);
// Payment cleared → proceed to the agent handler
await next();
};
};The payment target is a USDC contract on Base Sepolia (eip155:84532). The payTo address collects funds from every successfully verified call.
src/components/chat.js wraps the native fetch with the x402 client before every API call:
// Build a new x402 client for each message, bound to the connected wallet
const xClient = new x402Client();
xClient.register("eip155:84532", new ExactEvmScheme({
address: account,
// This triggers MetaMask to sign an EIP-712 USDC Permit (gasless authorization)
signTypedData: async (typedData) => await walletClient.signTypedData({ account, ...typedData }),
}));
// wrapFetchWithPayment intercepts the 402, handles signing & retry transparently
const wrap = wrapFetchWithPayment(fetch, xClient);
const response = await wrap(`/api/protected/${tier}`, { ... });The ExactEvmScheme uses an EIP-2612/EIP-3009 permit signature — a gasless, off-chain authorization that allows the facilitator to settle the USDC transfer without the user paying gas themselves.
Expo provides a single JavaScript codebase that compiles to iOS, Android, and Web. For Axiom, this means the same chat UI, wallet logic, and x402 payment flow works identically on a mobile device (native) and a desktop browser (web/SSR).
Axiom uses Expo Router's file-based routing for both screens and API endpoints. The API routes (src/api/) run on the same server as the Expo app (using Metro's server-side rendering output), powered by Hono — an ultralight web framework designed for edge runtimes.
src/
├── app/
│ └── (screens)/ # File-based navigation screens
│ ├── connect.js # Wallet connection gateway
│ ├── main.js # AI chat interface
│ └── dashboard.js # 0G ledger & sub-account metrics
├── api/
│ ├── protected/
│ │ ├── middleware/x402.js # Payment verification layer
│ │ └── handlers/
│ │ ├── basic.js # GPT-5.4-mini tier
│ │ ├── advance.js # Qwen3.6-plus tier
│ │ └── expert.js # DeepSeek-v3 tier
│ └── public/
│ ├── faucet.js # USDC testnet dispenser
│ └── info.js # Node health & status
└── core/
├── ZeroGAgent.js # Lean 0G inference engine
├── 0g-registry.js # Singleton agent cache
└── llm.js # Message formatting utilities
| Layer | Library | Responsibility |
|---|---|---|
| Wallet Connection | viem + window.ethereum |
EIP-1193 provider, account detection, chain events |
| Session Persistence | Browser cookies (7-day) | Auto-reconnect on page reload |
| Chain | Base Sepolia (eip155:84532) |
USDC payment settlement network |
| Payment Token | USDC 0x036CbD...Cf7e |
6-decimal ERC-20 on Base Sepolia |
| Payment Scheme | EIP-712 Typed Data Permit | Gasless USDC transfer authorization |
| Facilitator | https://x402.org/facilitator |
Off-chain signature verification oracle |
| Balance Display | viem.readContract + formatUnits(raw, 6) |
Live USDC balance in the sidebar |
When the user enables tools in the UI (X-Tools-Enabled: true header), the agent enters a multi-step tool-calling loop (max 5 iterations) before returning a final answer.
- Parallelized Tool Execution: Multiple tool calls are executed in parallel using
Promise.all, significantly reducing total response time for complex, multi-step reasoning tasks. - Real-time Observability: Utilizes a "Neural Trace" via MQTT to provide a live log of the agent's internal reasoning and tool execution to the end-user.
| Tool | Provider | Description |
|---|---|---|
web_search |
DuckDuckGo Scrape | Real-time web & news search |
finance_quote |
Yahoo Finance 2 | Live stock prices and market data |
get_weather |
wttr.in / Open-Meteo | Current weather for any location |
The tool loop runs entirely server-side inside ZeroGAgent.invoke(). Tool results are passed back to the 0G model as role: "tool" messages in the conversation history until the model returns a final text response with no further tool calls.
| Endpoint | Method | Auth | Description |
|---|---|---|---|
/api/public/info/status |
GET | None | Node status and 0G network info |
/api/public/info/health |
GET | None | Server uptime |
/api/public/faucet |
POST | None | Dispenses 0.1 USDC on Base Sepolia |
/api/protected/basic |
POST | x402 (USDC) | Basic tier inference (gpt-5.4-mini) |
/api/protected/advance |
POST | x402 (USDC) | Advanced tier inference (Qwen3.6+) |
/api/protected/expert |
POST | x402 (USDC) | Expert tier inference (DeepSeek-v3) |
/api/dashboard |
GET | None | Ledger balances and 0G sub-accounts |
- Innovation: First-of-its-kind integration of x402 payments with 0G decentralized compute.
- Efficiency: Global singleton brokers and endpoint caching eliminate decentralized network overhead.
- Portability: Lean, dependency-minimal core allows execution across diverse environments (Web, Mobile, Edge).
- Usability: The IDE proxy makes 0G models immediately accessible to developers without changing their existing workflows.
| Category | Technology |
|---|---|
| Cross-platform Framework | Expo SDK 54 / React Native 0.81 / React 19 |
| Navigation | Expo Router 6 (file-based, SSR-capable) |
| API Server | Hono (edge-native HTTP framework) |
| 0G Integration | @0glabs/0g-serving-broker 0.7.5 |
| Payment Protocol | @x402/core, @x402/fetch, @x402/evm 2.8.0 |
| Blockchain | ethers.js 6 (0G chain), viem 2 (Base Sepolia) |
| Message Rendering | react-native-markdown-display + KaTeX (LaTeX math) |
| List Virtualization | @shopify/flash-list |
| Finance Data | yahoo-finance2 |
| Web Search | duck-duck-scrape |
| Animations | react-native-reanimated 4 |
Axiom includes a specialized OpenAI-compatible proxy located in the 0g-openai-client/ directory. This allows you to use decentralized 0G models directly within coding IDEs like Zed, Continue, or Cursor by simply pointing them to a local or hosted Axiom endpoint.
- OpenAI Compatibility: Implements
/v1/chat/completionsand/v1/models. - Streaming Support: Full Server-Sent Events (SSE) streaming for real-time code generation.
- Auto-Model Mapping: Automatically maps generic model names (e.g.,
gpt-5,deepseek) to the best available 0G providers. - Zero-Config Web3: Handles all 0G broker signatures and on-chain settlement behind a standard API interface.
- Navigate to the client directory:
cd 0g-openai-client npm install - Configure your environment:
# Create a .env file PRIVATE_KEY=your_0g_funded_private_key PORT=3000 - Launch the proxy:
node index.js
To use 0G models in the Zed Editor, add the following to your settings.json:










