A decentralized AI inference marketplace connecting idle GPU power with developers and AI agents through micropayments.
EIN transforms idle GPU resources into a monetizable marketplace where developers and AI agents can access cost-effective AI inference through revolutionary per-request micropayments. Built on the X402 protocol, it enables instant, trustless transactions without intermediaries.
- Make API requests to available AI endpoints
- Pay $0.009 per request automatically via X402 protocol
- Get instant responses from distributed GPU providers
- No setup fees or monthly commitments
- Connect idle GPUs to the network
- Earn real-time payments for successful inference
- Set your own pricing in the marketplace
- Get paid instantly via smart contracts
- π Micropayment Infrastructure: X402 protocol enables $0.009 per-request payments
- π Permissionless Network: Open, censorship-resistant ecosystem
- β‘ Instant Settlements: Real-time payments for successful inference
- π Multi-Provider Support: ASI, OpenRouter, and Walrus Network integration
All API endpoints require payment via the X402 protocol. Here's how to send requests:
curl -X POST https://your-domain.com/api/asi/chat/completions \
-H "Content-Type: application/json" \
-H "X-Payment: [X402_PAYMENT_PROOF]" \
-d '{
"messages": [{"role": "user", "content": "Hello!"}],
"temperature": 0.7,
"max_tokens": 1024
}'curl -X POST https://your-domain.com/api/open-router/chat-completion/[provider]/[model] \
-H "Content-Type: application/json" \
-H "X-Payment: [X402_PAYMENT_PROOF]" \
-d '{
"messages": [{"role": "user", "content": "Hello!"}],
"temperature": 0.7
}'Sensitive data protection is automatically handled:
- API keys and authorization headers are redacted from logs
- Uses
fast-redactlibrary for secure data sanitization - Request bodies are filtered to remove sensitive information
- Only essential debugging information is preserved
Payment is required for all API endpoints:
| Endpoint | Price | Network | Description |
|---|---|---|---|
/api/asi/chat/completions |
$0.009 | base-sepolia | ASI chat inference |
/api/open-router/** |
$0.009 | base-sepolia | OpenRouter model access |
Payment Requirements:
- Facilitator URL:
https://x402.org/facilitator - Network: Base Sepolia (testnet)
- Timeout: 30 seconds maximum per request
- Payment Proof: Must include valid X402 payment proof in request headers
Failed Payment Handling:
- Requests without valid payment proof return HTTP 402 (Payment Required)
- Invalid payments are automatically rejected
- Payment verification happens before API processing
- Frontend: Next.js 15, TypeScript, Tailwind CSS, Radix UI
- Payment: X402 protocol with
@coinbase/x402andx402-next - API Integration: OpenRouter, ASI Alliance, Walrus Network
- Security: Request redaction, API key protection
-
Clone the repository
git clone https://github.com/your-org/ethereum-inference-network.git cd ethereum-inference-network -
Install dependencies
pnpm install
-
Configure environment
cp .env.example .env.local # Set your API keys and wallet address -
Run development server
pnpm dev
# Payment Configuration
PAYMENT_RECEIVING_WALLET_ADDRESS=0x...
# API Keys
ASI_API_KEY=your_asi_api_key
OPENROUTER_API_KEY=your_openrouter_api_key- ASI:
/api/asi/chat/completions- Artificial Superintelligence Alliance - OpenRouter:
/api/open-router/**- Multiple AI model providers - Walrus:
/api/walrus/- Walrus Network integration
Live at 0xBd5E8518091e19c562cCE62FE26830f586972084 on Base Mainnet
The EIN Registry is the backbone of our decentralized inference network, enabling trustless discovery and registration of AI inference nodes. Node operators stake ETH to join the network, while users discover and connect to reliable AI providers.
| Feature | Description | Details |
|---|---|---|
| π° Node Registration | Operators stake 1 ETH | Ensures commitment & network quality |
| π€ Provider/Model Support | Flexible AI provider integration | OpenAI, Anthropic, Mistral, etc. |
| π³ Per-Request Pricing | Simple, transparent pricing | Pay per inference request, not tokens |
| π Payment Separation | Secure payment handling | Operator & payment addresses separated |
| β Reputation System | Quality assurance | 0-10000 scale performance tracking |
| π Model Discovery | Easy provider/model lookup | Find nodes by specific requirements |
Each registered node maintains comprehensive service information:
struct Node {
address operator; // Node controller address
address paymentAddress; // Payment destination
string baseEndpoint; // API base URL
string provider; // "openai", "anthropic", etc.
string[] models; // Supported model list
uint256[] pricesPerRequest; // Per-model pricing (wei)
uint256 reputation; // Performance score (0-10000)
uint256 stakedAmount; // ETH stake amount
}For Node Operators:
// Register new node (requires 1 ETH stake)
registerNode(
string baseEndpoint, // "https://api.mynode.com"
string provider, // "openai"
address paymentAddress, // 0x123...
string[] models, // ["gpt-4", "gpt-3.5-turbo"]
uint256[] pricesPerRequest // [0.001 ether, 0.0005 ether]
)
// Update node configuration
updateNode(string baseEndpoint, string provider, string[] models, uint256[] pricesPerRequest)
// Update payment destination
updatePaymentAddress(address newPaymentAddress)
// Adjust model pricing
updatePrice(string model, uint256 newPrice)
// Leave network & withdraw stake
deactivateNode()For Users & Integrators:
// Discover nodes by provider/model
getNodesByProviderModel("openai", "gpt-4") β address[]
// Get complete endpoint URL
getEndpointUrl(nodeAddress, "gpt-4") β "https://api.mynode.com/openai/gpt-4"
// Get comprehensive node details
getNodeDetailsForProviderModel("openai", "gpt-4")
β (operators[], paymentAddresses[], endpoints[], prices[], reputations[])
// List all active providers
getAllProviders() β string[]
// Get all network nodes
getAllActiveNodes() β address[]All inference nodes follow a standardized URL structure:
[baseEndpoint]/[provider]/[model]
Examples:
https://api.mynode.com/openai/gpt-4https://api.mynode.com/anthropic/claude-3https://inference.example.com/mistral/mixtral-8x7b
Registering as a Node Provider:
const tx = await registry.registerNode(
"https://api.myservice.com",
"openai",
"0xPaymentAddress...",
["gpt-4", "gpt-3.5-turbo"],
[ethers.parseEther("0.001"), ethers.parseEther("0.0005")],
{ value: ethers.parseEther("1.0") }
);Finding and Using Nodes:
// Discover GPT-4 providers
const nodes = await registry.getNodesByProviderModel("openai", "gpt-4");
// Get optimized endpoint
const endpoint = await registry.getEndpointUrl(nodes[0], "gpt-4");
// Fetch detailed provider info
const details = await registry.getNodeDetailsForProviderModel("openai", "gpt-4");
// Compare prices and reputations to select best provider- π Stake-Based Security: 1 ETH minimum stake ensures node commitment
- β Reputation Tracking: Performance-based scoring (0-10000 scale)
- π‘οΈ Payment Isolation: Separate operator and payment addresses
- π Event Transparency: All actions logged via smart contract events
- π Withdrawal Protection: Only operators can deactivate nodes