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

aiworker-openai-agents-tools

v0.1.0

Published

aiworker's paid x402 data routes as OpenAI Agents SDK tools — inject the SDK's tool() and each tool pays its own call in USDC on Base

Readme

aiworker for the OpenAI Agents SDK

Paid aiworker routes as OpenAI Agents SDK tools. One import builds a tool per route from the live OpenAPI catalogue; each call pays over x402 from your own Base wallet. Copy src/ into your agent, not this directory listing.

Install

npm i aiworker-openai-agents-tools @openai/agents

Then copy src/ (catalog.ts, schema.ts, payer.ts, types.ts, tools.ts) and build the tools with the framework's tool injected (this package never imports @openai/agents itself):

import { Agent, tool } from "@openai/agents";
import { buildAiworkerTools } from "./src/index.js";
const tools = await buildAiworkerTools({
  tool,
  privateKey: process.env.AIWORKER_PRIVATE_KEY as `0x${string}`,
  maxPriceUsd: 0.05,
});
const agent = new Agent({ name: "aiworker", instructions: "Answer with live data.", tools });

Prefer plain definitions (no framework needed) with aiworkerToolDefinitions({ baseUrl, maxPriceUsd, routes }), then pass each one to tool() yourself.

Wallet

You need a Base wallet holding USDC. The key stays in an env var (AIWORKER_PRIVATE_KEY); it is never logged, committed, or sent anywhere except as an EIP-3009 signature inside the x402 payment header.

Price cap

maxPriceUsd drops every route priced above it (default: no cap). The example uses 0.05, so only sub-nickel routes become tools. Each tool description carries its exact per-call price ($0.05 per call, USDC on Base).

No key, pay per call

No API key to manage — no key, pay per call: every tool call pays its own quoted price over x402 (USDC on Base) straight from your wallet.

Routes and prices

| Tool | Route | Price | |---|---|---| | aiworker_get_v1_token_info | GET /v1/token/info | $0.005 | | aiworker_post_v1_scrape_markdown | POST /v1/scrape/markdown | $0.02 | | aiworker_post_v1_polymarket_backtest | POST /v1/polymarket/backtest | $0.25 |

The table is the trimmed fixture; the live catalogue has seventeen routes, all priced at $0.05 or less — see the catalogue at https://aiworker.duckdns.org/llms.txt.

Example

AIWORKER_PRIVATE_KEY=0x… pnpm --filter @aiworker/example-openai-agents example

Lists the capped tools, calls token/info once for Base USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913), and prints the answer plus the settlement hash. Refuses to run without the key (exit 2).

What it does not do

  • No Solana: EVM/Base only, even where the server also quotes Solana.
  • No MCP: plain SDK tools, not a Model Context Protocol server.
  • No retries of a failed settlement: a non-2xx answer comes back as {"error": <status>, "body": …} and the call is over.
  • No free routes: /health and the catalogue itself never become tools.
  • No key management: bring your own funded wallet and env var.