@zeromodern/agentkit-provider-0mod
v2.0.1
Published
Coinbase AgentKit action provider for the 0mod API Gateway
Maintainers
Readme
@zeromodern/agentkit-provider-0mod
Coinbase AgentKit action provider for the 0mod API Gateway. HTTP 402 micropayments on Base EVM are handled automatically.
Wallet & Network Prerequisites
0mod gateway utilities use x402 HTTP 402 micropayments on Base EVM:
- Network: Base Mainnet (
eip155:8453) - Asset: USDC on Base
- Environment Variable:
PAYER_PRIVATE_KEY=0x...(orEVM_PRIVATE_KEY/X402_PRIVATE_KEY)
When PAYER_PRIVATE_KEY is present in your bot's environment, actions transparently sign payment authorizations and execute with zero manual intervention.
Requirements
- Node.js >= 18
- npm >= 9
Install
npm install @zeromodern/agentkit-provider-0modSetup & Code Example
import { AgentKit } from "@coinbase/agentkit";
import { zeroModActionProvider, ZeroModActionProvider } from "@zeromodern/agentkit-provider-0mod";
// Set PAYER_PRIVATE_KEY in process.env for automatic 402 payment signing
process.env.PAYER_PRIVATE_KEY = "0x_your_private_key_here";
const agentKit = await AgentKit.from({
actionProviders: [
zeroModActionProvider(),
],
});
// Call an action directly using the provider
const provider = new ZeroModActionProvider();
const resultJson = await provider.domainCheck(null, { domain: "base.org" });
console.log("Domain Check Output:", JSON.parse(resultJson));Practical Real-World Example: Quant Backtest Sprint ($1k/mo Subscription Alternative)
Institutional crypto data feeds (Kaiko, Amberdata, CoinMetrics) charge $1,000 to $3,000/month recurring minimum commitments for cross-venue spread OHLC candles, market dislocations, and execution latency benchmarks.
With @zeromodern/agentkit-provider-0mod, quants and autonomous AI agents pay strictly per telemetry slice via HTTP 402 micropayments on Base USDC. Pricing is dynamically negotiated per request via the gateway's HTTP 402 challenge header (view live rates at api.0mod.com), allowing a complete 24-hour high-resolution strategy backtest to execute for micropayments instead of an enterprise $1,000/month commitment.
See examples/quant_backtest_sprint.ts for the full runnable script.
Available Actions
💡 Pricing: The table below lists per-call USDC prices as published by the gateway discovery manifest. For live rates and endpoint status, visit api.0mod.com or
GET https://api.0mod.com/api/v1/discovery. All calls are settled per request via HTTP 402 micropayments on Base USDC.
| Action Name | Gateway Endpoint | Price (USDC) | Description | Input Schema Example |
| :--- | :--- | :--- | :--- | :--- |
| stealth_dom_fetch | POST /stealth-dom | $0.00400 | Headless web page fetch from Cloudflare edge | { "url": "https://example.com" } |
| airgap_pii_scrub | POST /airgap-scrub | $0.00400 | Redact SSN, phone, email, ZIP via Workers AI | { "text": "Call me at 555-0199" } |
| domain_check | POST /domain-check | $0.00800 | Query RDAP registry for domain availability | { "domain": "example.com" } |
| dex_price_summary | POST /dex-price-summary | $0.00150 | Real-time DEX token price, volume, liquidity | { "query": "USDC" } |
| image_ocr_shrink | POST /image-ocr-shrink | $0.00800 | Vision OCR text and table extraction | { "imageUrl": "https://..." } |
| crypto_coverage | GET /crypto/coverage | Free | Check data coverage, supported pairs, and date boundaries | { "pair": "AERO/USD" } |
| crypto_spread_candles | GET /crypto/spread-candles | $0.01500 | Fetch cross-venue CEX-DEX spread candles (OHLC) | { "pair": "AERO/USD", "date": "2026-09-14" } |
| crypto_dislocations | GET /crypto/dislocations | $0.04500 | Fetch cross-venue market dislocation and spread arbitrage events | { "pair": "AERO/USD", "date": "2026-09-14" } |
| crypto_execution_latency | GET /crypto/execution-latency | $0.07500 | Benchmark cross-venue execution speed, venue latencies, and fill rates | { "date": "2026-09-14" } |
| crypto_impact_simulation | POST /crypto/impact-simulation | $0.07500 | Simulate order-book impact: expected fill price, slippage, fill ratio & executable levels | { "pair": "AERO/USD", "side": "buy", "size_usd": 10000 } |
Usage Example — crypto_impact_simulation (pre-trade order impact)
Simulates consuming order-book depth for a given side and size (size_usd or size_base). Outputs expected_fill_price, slippage_bps, fillable_size_base/fillable_size_usd, fill_ratio, full_fill_probability, partial_fill_probability, executable, and levels_consumed.
const raw = await provider.cryptoImpactSimulation({} as any, {
pair: "AERO/USD",
side: "buy",
size_usd: 10000,
});
const sim = JSON.parse(raw);
console.log(
`executable=${sim.executable} fill_price=${sim.expected_fill_price} ` +
`slippage=${sim.slippage_bps}bps fill_ratio=${sim.fill_ratio} ` +
`full=${sim.full_fill_probability} partial=${sim.partial_fill_probability} ` +
`levels=${sim.levels_consumed}`
);Ecosystem Packages
- 🤖 MCP Server (Any AI Agent):
@zeromodern/mcp-server-0mod - 🟣 ElizaOS Plugin:
@zeromodern/eliza-plugin-0mod - 🔵 Coinbase AgentKit Provider:
@zeromodern/agentkit-provider-0mod - ⚡️ Live Gateway Service: api.0mod.com
Troubleshooting
- Import error: Make sure you're importing from
@zeromodern/agentkit-provider-0mod. - Payment / Auth errors: Ensure
PAYER_PRIVATE_KEYis set with a valid Base EVM private key holding a USDC balance for x402 micropayments.
Release Process
Releases are cut manually by the owner via a GitHub Release — publishing to npm is triggered by creating the Release, and the owner chooses the major/minor/patch bump. See RELEASING.md for the full steps.
License
MIT
