npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jatevo-x402-sdk

v1.3.0

Published

Simple axios interceptor for Jatevo x402 LLM API - Works in terminals, VSCode, and Node.js

Readme

jatevo-x402-sdk

Simple axios interceptor for Jatevo x402 LLM API - Works in terminals, VSCode, and Node.js

🆕 Version 1.3.0 - GLM 4.6 Support

Added support for the latest GLM 4.6 model with enhanced reasoning capabilities. Simple axios interceptor pattern that works perfectly in terminals, VSCode, and any Node.js environment!

Features

  • 🎯 Simple Integration - Just wrap your axios instance with our interceptor
  • 🖥️ Terminal/CLI Ready - Works perfectly in Node.js, terminals, and VSCode
  • 🚀 No API Keys Required - Your wallet address is your authentication
  • 💰 Pay-Per-Use - Only pay for what you actually use ($0.01 per request)
  • Instant Settlement - Payments handled through PayAI facilitator
  • 🌐 Dual Network Support - Choose between Base or Solana for payments
  • 🤖 Multiple Models - Access to Qwen, GLM, Kimi, DeepSeek, and GPT-OSS
  • 🔒 Secure - EIP-3009 compliant (Base) and SPL token transfers (Solana)
  • 📦 TypeScript Support - Full type definitions included
  • 🔑 Private Key Support - Works with private keys for terminal/CLI usage

Installation

npm install jatevo-x402-sdk
# or
yarn add jatevo-x402-sdk
# or
pnpm add jatevo-x402-sdk

Quick Start

const { withPaymentInterceptor } = require('jatevo-x402-sdk');
const axios = require('axios');

// Your EVM private key (keep this secure!)
const PRIVATE_KEY = process.env.PRIVATE_KEY;

// Create axios client with payment interceptor
const client = withPaymentInterceptor(axios.create(), PRIVATE_KEY);

// Make API requests - payments are handled automatically
const response = await client.post('https://api.jatevo.ai/chat/completions/qwen', {
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Explain async/await in JavaScript' }
  ],
  temperature: 0.7,
  max_tokens: 200
});

console.log(response.data.choices[0].message.content);

How It Works

  1. Request Sent: Your request is sent to the Jatevo API
  2. 402 Response: If payment is required, the API returns a 402 status
  3. Auto-Payment: SDK creates a payment header using your private key
  4. Retry Request: Request is automatically retried with payment
  5. Get Response: You receive the API response seamlessly

Configuration Options

The SDK uses a simple pattern with minimal configuration:

const { withPaymentInterceptor } = require('jatevo-x402-sdk');
const axios = require('axios');

// Basic usage with private key
const client = withPaymentInterceptor(
  axios.create(),  // Your axios instance
  privateKey        // Your EVM private key (for Base) or Solana private key
);

Available Models

| Model ID | Name | Description | Price | |----------|------|-------------|-------| | qwen | Qwen 3 Coder 480B | Advanced code generation and analysis | $0.01 | | glm-4.6 | GLM 4.6 | Latest GLM model with enhanced reasoning | $0.01 | | glm-4.5 | GLM 4.5 | Advanced reasoning and problem-solving | $0.01 | | kimi | Kimi K2 | Long context understanding | $0.01 | | deepseek-r1-0528 | DeepSeek R1 0528 | Latest reasoning model | $0.01 | | deepseek-v3.1 | DeepSeek V3.1 | Efficient chat model | $0.01 | | gpt-oss | GPT-OSS | OpenAI's efficient model | $0.01 |

Example Usage

Basic Chat Completion

const { withPaymentInterceptor } = require('jatevo-x402-sdk');
const axios = require('axios');

async function chat() {
  const client = withPaymentInterceptor(
    axios.create(),
    process.env.PRIVATE_KEY
  );
  
  try {
    const response = await client.post(
      'https://api.jatevo.ai/chat/completions/qwen',
      {
        messages: [
          { role: 'user', content: 'What is the capital of France?' }
        ],
        temperature: 0.7,
        max_tokens: 100
      }
    );
    
    console.log(response.data.choices[0].message.content);
  } catch (error) {
    console.error('Error:', error.message);
  }
}

chat();

Streaming Responses

const response = await client.post(
  'https://api.jatevo.ai/chat/completions/kimi',
  {
    messages: [...],
    stream: true
  },
  {
    responseType: 'stream'
  }
);

response.data.on('data', chunk => {
  console.log(chunk.toString());
});

Using Different Models

// Qwen model
await client.post('https://api.jatevo.ai/chat/completions/qwen', {...});

// GLM models
await client.post('https://api.jatevo.ai/chat/completions/glm-4.6', {...});  // Latest
await client.post('https://api.jatevo.ai/chat/completions/glm-4.5', {...});

// Kimi K2 model
await client.post('https://api.jatevo.ai/chat/completions/kimi', {...});

// DeepSeek models
await client.post('https://api.jatevo.ai/chat/completions/deepseek-r1-0528', {...});
await client.post('https://api.jatevo.ai/chat/completions/deepseek-v3.1', {...});

// GPT-OSS model
await client.post('https://api.jatevo.ai/chat/completions/gpt-oss', {...});

Error Handling

The SDK provides clear error messages:

try {
  const response = await client.post(...);
} catch (error) {
  if (error.response?.status === 402) {
    console.error('Payment required but failed:', error.message);
  } else if (error.response?.status === 429) {
    console.error('Rate limit exceeded');
  } else {
    console.error('API error:', error.message);
  }
}

Network Support

The SDK automatically handles payments on both Base and Solana networks:

  • Base Network: Fast settlement (~200ms) using USDC on Base L2
  • Solana Network: Reliable settlement (~400ms) using USDC on Solana

Simply provide your private key and the SDK handles the rest - no network configuration needed!

Migration from v1.x

If you were using v1.0.x or v1.1.x, update your code:

Old Pattern (v1.0.x/v1.1.x)

// Complex client initialization
const client = new X402Client({
  baseUrl: 'https://api.jatevo.ai',
  privateKey: PRIVATE_KEY,
  network: 'base'
});

const response = await client.chat.completions(...);

New Pattern (v1.2.0) - Simpler!

// Simple axios interceptor
const client = withPaymentInterceptor(axios.create(), PRIVATE_KEY);
const response = await client.post('https://api.jatevo.ai/chat/completions/qwen', {...});

Benefits of v1.2.0

  • Simpler API: Just one function - withPaymentInterceptor
  • No Browser Dependencies: Works in any Node.js environment
  • Smaller Bundle: Reduced from ~50KB to ~5KB
  • Better Error Handling: Clear error messages
  • PayAI Integration: Automatic retry on payment failures

TypeScript Types

import type {
  X402Config,
  LLMMessage,
  LLMRequest,
  LLMResponse,
  ModelType,
  ModelInfo,
  PaymentRequirements,
  EVMPaymentData,
  SolanaPaymentData
} from 'jatevo-x402-sdk';

Support

  • Documentation: https://jatevo.ai/x402/documentation
  • Website: https://jatevo.ai
  • Issues: https://github.com/jatevo/x402-sdk/issues

License

MIT © Jatevo