x402-client
Client SDK for the Vybe x402 API. Pay-per-call USDC over HTTP and prepaid-credit WebSocket streaming for Vybe's Solana analytics API. Built for AI agents.
What is x402-client?
Client SDK for the Vybe x402 API. Pay-per-call USDC over HTTP and prepaid-credit WebSocket streaming for Vybe's Solana analytics API. Built for AI agents.
Overview of x402-client
What it is
A client SDK for the Vybe x402 API. It provides pay-per-call USDC micropayments over HTTP and prepaid-credit WebSocket streaming for Vybe's Solana analytics API. It is built for AI agents and eliminates the need for API keys or subscriptions, requiring only a Solana wallet.
Key features
- HTTP pay-per-call: each request settles a USDC micropayment (default $0.001, up to $0.010 on heavier endpoints).
- Prepaid WebSocket sessions: one $0.01 payment buys 1000 credits (≈995 events after the 5-credit connection charge); auto-topup is supported.
- Budget caps: set a
maxUsdlimit and the SDK rejects calls before signing. - Drop-in integration for AI agents: uses standard
client.get()/client.request()methods with no special AI helpers. - Typed errors: provides
ApiErrorandNetworkErrorclasses for structured error handling. - Rate limit: 600 paid HTTP requests per minute per wallet (sliding window).
Use cases
- Querying Solana token data (e.g., top holders, token balances) via pay-per-call HTTP.
- Streaming real-time Solana events (trades, transfers, oracle prices, price candles, new tokens) over WebSocket with prepaid credits.
- Integrating Vybe's analytics API into AI agent tool-calling loops without API key management.
- Managing API spend with budget caps and per-request micropayments.
Getting started
Install: npm install @vybenetwork/x402-client Quick-start code is provided in the repository README and requires a Solana keypair funded with USDC on mainnet. See the repository for full setup and example.
License and pricing
MIT license. Pricing is currently a beta discount with default $0.001 per HTTP call, $0.003/$0.005/$0.008/$0.010 on heavier endpoints, and $0.01 per WebSocket session of 1000 credits. Rates will increase at general availability. Traditional flat-fee subscription is also available at vybe.fyi/api-pricing.
Based on the project's public README and repository metadata.