SDK

One line to
chat completions.

Send chat completion requests with a single method call. The Router402 SDK handles smart accounts, session keys, and API authentication so you can focus on building.

index.ts
import { Router402Sdk } from "@router402/sdk";

// Initialize with your JWT token
const sdk = new Router402Sdk({
  token: "your-jwt-token",
});

// Send a chat completion request
const response = await sdk.chat("What is ERC-4337?");
console.log(response);

// Use a different model
const answer = await sdk.chat("Explain account abstraction", {
  model: "anthropic/claude-haiku-4.5",
});
$ npm install @router402/sdk

See it in action

A few lines of code to start chatting with any AI model, powered by crypto micropayments.

Terminal

Built for developers and agents

A simple chat interface backed by smart accounts, session keys, and gasless transactions on Base.

Simple Chat Interface

Send chat completions with a single method call. sdk.chat(prompt) abstracts away all API complexity.

Session Key Auth

Generate, approve, and manage session keys for delegated access. Perfect for backend services and autonomous agents.

Gasless Transactions

All transactions are sponsored via Pimlico paymaster. No ETH required for gas fees.

Account Abstraction (ERC-4337)

Built on ERC-4337 with ZeroDev Kernel accounts. Smart account features like batched transactions and programmable permissions.

Full Setup Flow

One-call setupAccount method handles the entire flow: deploy account, generate session key, approve, and enable on-chain.

TypeScript & viem

First-class TypeScript support with full type safety. Built on viem for reliable EVM interactions.

Why use Router402 SDK?

One-line chat completions with sdk.chat()
Multi-model support (Claude, Gemini)
Gasless transactions via Pimlico paymaster
Session key generation and approval
One-call account setup flow
ERC-4337 account abstraction
Full TypeScript type safety
Agent and bot friendly

Start building today

From setup to chat completions in minutes. Install the SDK and start sending requests.