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

@agentclear/sdk

v0.1.0

Published

Official SDK for Agent Clear — the AI agent service marketplace

Readme

@agentclear/sdk

Official SDK for Agent Clear — the AI agent service marketplace.

Agent Clear lets AI agents discover and pay for API services. This SDK provides:

  • Provider middleware — protect your API with the 402 viral loop so agents can discover and pay for your service
  • Consumer client — discover and call services through the Agent Clear metered proxy

Installation

npm install @agentclear/sdk

Quick Start: Consumer (AI Agent)

Discover and call services through Agent Clear:

import { AgentClearClient } from "@agentclear/sdk";

const client = new AgentClearClient({ apiKey: "axk_your_key_here" });

// Discover services by natural language query
const { services } = await client.discover("sentiment analysis");
console.log(services);

// Call a service through the metered proxy
const result = await client.call(services[0].id, {
  text: "I love this product!",
});
console.log(result.data);

Quick Start: Provider (402 Middleware)

Wrap your API so unauthorized agents receive a structured 402 response pointing them to Agent Clear:

Express

import express from "express";
import { requireAgentClear } from "@agentclear/sdk";

const app = express();

app.use(
  requireAgentClear({
    serviceId: "my-sentiment-api",
    pricePerCall: 0.005,
  })
);

app.post("/analyze", (req, res) => {
  // Your API logic — only reached by authenticated agents
  res.json({ sentiment: "positive", score: 0.95 });
});

app.listen(3000);

Any Framework (Generic Verifier)

import { verifyAgentClearRequest } from "@agentclear/sdk";

const verify = verifyAgentClearRequest({
  serviceId: "my-api",
  pricePerCall: 0.005,
});

// In your request handler:
const result = verify(request.headers);
if (!result.valid) {
  return new Response(JSON.stringify(result.error), {
    status: 402,
    headers: { "Content-Type": "application/json" },
  });
}

When an agent calls your API without a valid key, they receive:

{
  "error": "Payment Required",
  "message": "This API requires $0.005/call via Agent Clear.",
  "signup_url": "https://agentclear.dev/signup",
  "docs_url": "https://agentclear.dev/docs",
  "service_id": "my-sentiment-api",
  "price_per_call": 0.005,
  "platform": "agentclear"
}

API Reference

AgentClearClient

new AgentClearClient(options: {
  apiKey: string;       // Required — your axk_ API key
  baseUrl?: string;     // Default: "https://agentclear.dev"
  frameworkRef?: string; // Optional framework ref for rev-share
})

client.discover(query, options?)

Search for services by natural language.

| Parameter | Type | Default | Description | | --------------- | ---------- | ------- | --------------------- | | query | string | — | Semantic search query | | options.limit | number | 10 | Max results | | options.tags | string[] | — | Filter by tags |

Returns Promise<DiscoverResponse>.

client.call(serviceId, payload, options?)

Call a service through the metered proxy.

| Parameter | Type | Default | Description | | ----------------- | -------- | -------- | ---------------------- | | serviceId | string | — | Service to call | | payload | any | — | JSON body to forward | | options.timeout | number | 30000 | Timeout in ms |

Returns Promise<ServiceResponse>.

client.services(options?)

List available services with optional filtering.

| Parameter | Type | Default | Description | | ------------------ | -------- | ------- | ------------------------ | | options.limit | number | — | Max results | | options.offset | number | — | Pagination offset | | options.protocol | string | — | Filter by protocol |

Returns Promise<ServicesResponse>.

requireAgentClear(options)

Express/Connect middleware that returns 402 for unauthenticated requests.

verifyAgentClearRequest(options)

Framework-agnostic verifier. Returns a function that accepts headers and returns { valid, userId?, error? }.

Documentation

Full documentation at https://agentclear.dev/docs.

License

MIT — see LICENSE.