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

@synapse-network-ai/sdk

v1.0.1

Published

Official TypeScript SDK for SynapseNetwork agent service discovery, paid API invocation, and receipts.

Downloads

210

Readme

SynapseNetwork TypeScript SDK

Official TypeScript SDK for agents and applications that use SynapseNetwork to discover services, invoke APIs, and receive auditable USDC settlement receipts.

SynapseNetwork gives agents a scoped Agent Key instead of an unlimited API key or credit card. Your code can search for a service, invoke it with an explicit price or spend cap, then verify the receipt that records what happened.

Install

npm install @synapse-network-ai/sdk

ethers is a peer dependency only for owner wallet authentication and provider publishing flows:

npm install ethers

Five-minute quickstart

Create an Agent Key in the SynapseNetwork dashboard, then pass it to SynapseClient.

Production is the default SDK environment and uses:

https://api.synapse-network.ai

Search for a service, invoke it with the discovered fixed price, then read the receipt:

import { SynapseClient } from "@synapse-network-ai/sdk";

const client = new SynapseClient({
  credential: process.env.SYNAPSE_AGENT_KEY!,
  environment: "prod",
});

const services = await client.search("invoice extraction", { limit: 5 });
const service = services[0];

const result = await client.invoke(
  service.serviceId ?? service.id!,
  { invoice_url: "https://example.com/invoice.pdf" },
  {
    costUsdc: String(service.pricing?.amount ?? "0"),
    idempotencyKey: "invoice-job-001",
  }
);

const receipt = await client.getInvocation(result.invocationId);
console.log(receipt.status, receipt.chargedUsdc);

Try the free echo service

For a production connectivity smoke test, call the first-party echo service. It is intended for SDK checks and should charge 0 USDC.

export SYNAPSE_AGENT_KEY=agt_xxx
import { SynapseClient } from "@synapse-network-ai/sdk";

const client = new SynapseClient({
  credential: process.env.SYNAPSE_AGENT_KEY!,
  environment: "prod",
});

const result = await client.invoke(
  "svc_synapse_echo",
  { message: "hello from the TypeScript SDK" },
  {
    costUsdc: "0",
    idempotencyKey: "typescript-echo-001",
  }
);

const receipt = await client.getInvocation(result.invocationId);
console.log(receipt.status, receipt.chargedUsdc);

Invocation modes

| Mode | Use for | SDK method | Billing input | | --- | --- | --- | --- | | Fixed-price API | Normal provider APIs with a known price | invoke() | Pass the latest discovered price as costUsdc | | Token-metered LLM | LLM services priced by input and output tokens | invokeLlm() | Pass an optional spend cap such as maxCostUsdc |

LLM example:

const result = await client.invokeLlm(
  "svc_deepseek_chat",
  {
    messages: [{ role: "user", content: "Summarize this document." }],
    max_tokens: 512,
  },
  {
    maxCostUsdc: "0.010000",
    idempotencyKey: "llm-job-001",
  }
);

console.log(result.usage?.inputTokens, result.usage?.outputTokens);
console.log(result.synapse?.chargedUsdc);

Provider APIs

Most users start as consumers with SynapseClient. If you operate an API that agents should call, use SynapseAuth and the provider facade from backend or operator tooling after owner authentication.

Provider setup lets you register services, publish pricing, inspect health, and reconcile earnings. Keep normal agent runtime code on SynapseClient with an existing Agent Key.

Safety rules

  • Do not commit Agent Keys, owner private keys, provider secrets, wallet seed phrases, or production tokens.
  • Pass money values as strings such as "0" or "0.05"; do not recompute settlement amounts with floating-point math.
  • Use the discovered fixed price for invoke() and a spend cap for invokeLlm().
  • Use gatewayUrl only for private deployments or documented sandboxes. Public examples should target production.

Links

License

MIT