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

@agent-inc/ai-sdk-provider

v1.0.0

Published

Vercel AI SDK provider for Agent Inc. — access Claude, GPT, Gemini & 30+ models with API key or pay-per-inference SOL micropayments via x402

Readme

@agent-inc/ai-sdk-provider

npm version npm bundle size license

Vercel AI SDK provider for Agent Inc. — access Claude, GPT, Gemini, DeepSeek, Grok and 30+ models through a single provider. Pay with an API key or trustless per-request SOL micropayments via the x402 protocol on Solana.

Installation

npm install @agent-inc/ai-sdk-provider
# or
pnpm add @agent-inc/ai-sdk-provider
# or
bun add @agent-inc/ai-sdk-provider

For x402 SOL payment mode (optional):

npm install @agent-inc/ai-sdk-provider @solana/kit

Quick Start

API Key Mode

The simplest way to get started. Pass your API key directly or set the AGENTINC_API_KEY environment variable.

import { createAgentInc } from "@agent-inc/ai-sdk-provider";
import { generateText } from "ai";

const agentinc = createAgentInc({
  apiKey: process.env.AGENTINC_API_KEY,
});

const { text } = await generateText({
  model: agentinc("anthropic/claude-sonnet-4"),
  prompt: "What is Agent Inc.?",
});

Or use the default instance which reads from the AGENTINC_API_KEY env var:

import { agentinc } from "@agent-inc/ai-sdk-provider";
import { streamText } from "ai";

const result = streamText({
  model: agentinc("anthropic/claude-sonnet-4"),
  prompt: "Explain the x402 payment protocol",
});

for await (const chunk of result.textStream) {
  process.stdout.write(chunk);
}

x402 SOL Payment Mode

Trustless, per-request micropayments on Solana. No API key needed — pay directly from your wallet for each inference call.

import { createAgentInc } from "@agent-inc/ai-sdk-provider";
import { generateText } from "ai";
import { readFileSync } from "fs";
import { homedir } from "os";
import { join } from "path";

// Load your Solana keypair (64 bytes: 32 private + 32 public)
const keypair = new Uint8Array(
  JSON.parse(readFileSync(join(homedir(), ".config/solana/id.json"), "utf-8")),
);

const agentinc = createAgentInc({
  solanaSecretKey: keypair,
  solanaNetwork: "solana-devnet", // Use "solana" for mainnet
});

const { text } = await generateText({
  model: agentinc("openai/gpt-5-mini"),
  prompt: "How do Solana micropayments work?",
});

How x402 works under the hood:

  1. The provider sends your request to the AgentInc API
  2. The server responds with HTTP 402 and SOL payment requirements
  3. The provider automatically builds a SOL transfer transaction, signs it with your keypair, and retries with the payment attached
  4. The server verifies and settles the payment on-chain, then streams the AI response

Supported Models

All models on the Vercel AI Gateway are supported. Popular picks:

| Model ID | Price (in / out per 1M tokens) | | ----------------------------- | ------------------------------ | | anthropic/claude-haiku-4.6 | Fast, cost-efficient (default) | | anthropic/claude-sonnet-4.6 | Balanced | | anthropic/claude-opus-4.6 | Highest capability | | openai/gpt-5-nano | $0.05 / $0.40 | | openai/gpt-5-mini | $0.25 / $2.00 | | openai/gpt-5.4 | $2.50 / $15.00 | | google/gemini-2.5-flash | $0.30 / $2.50 | | google/gemini-2.5-pro | $1.25 / $10.00 | | deepseek/deepseek-v3.2 | $0.28 / $0.42 | | xai/grok-4-fast-reasoning | $0.20 / $0.50 |

Any provider/model string is accepted — the type hints provide autocomplete, not restrictions.

Embedding models:

| Model ID | Description | | ------------------------------- | ------------------- | | openai/text-embedding-3-large | 1536-dim embeddings | | openai/text-embedding-3-small | 512-dim embeddings |

Configuration

import { createAgentInc } from "@agent-inc/ai-sdk-provider";

const agentinc = createAgentInc({
  // API key auth (reads AGENTINC_API_KEY env var if omitted)
  apiKey: "sk-...",

  // Custom API base URL
  baseURL: "https://agentinc.fun/api/v1",

  // Extra headers for all requests
  headers: { "X-Custom": "value" },

  // x402 SOL payment options (alternative to apiKey)
  solanaSecretKey: keypairBytes, // 64-byte Uint8Array
  solanaNetwork: "solana", // "solana" | "solana-devnet"
  solanaRpcUrl: "https://my-rpc.com", // Custom RPC endpoint
});

Embeddings

import { createAgentInc } from "@agent-inc/ai-sdk-provider";
import { embed } from "ai";

const agentinc = createAgentInc();

const { embedding } = await embed({
  model: agentinc.embeddingModel("openai/text-embedding-3-large"),
  value: "What is the meaning of life?",
});

Environment Variables

| Variable | Description | | ------------------ | -------------------------------------------------------- | | AGENTINC_API_KEY | API key for bearer token auth (used by default instance) |

Links

License

MIT