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

agents-eco-sdk

v0.1.0

Published

Official TypeScript/JavaScript SDK for the agents.eco API

Readme

@agents-eco/sdk

Official TypeScript/JavaScript SDK for the agents.eco API.

Installation

npm install @agents-eco/sdk

Quick Start

import { AgentsEco } from "@agents-eco/sdk";

const client = new AgentsEco({ apiKey: "ak_your_api_key" });

// Check balance
const { availableBalanceUsdc } = await client.getBalance();
console.log(`Balance: $${(Number(availableBalanceUsdc) / 1e6).toFixed(2)} USDC`);

// Create an agent
const agent = await client.createAgent({
  name: "Research Bot",
  systemPrompt: "You are a helpful research assistant.",
  memoryEnabled: true,
});
console.log(`Created agent: ${agent.id}`);

// Chat with the agent
const response = await client.chat(agent.id, "What are the latest trends in AI?");
console.log(response.response);

Authentication

There are two ways to authenticate:

API Key (recommended for server-side)

const client = new AgentsEco({ apiKey: "ak_your_api_key" });

Session Token (for browser/wallet-based auth)

// 1. Get a challenge
const challenge = await AgentsEco.getChallenge(walletAddress, "login");

// 2. Sign the message with the user's wallet
const signature = await wallet.signMessage(challenge.message);

// 3. Login
const { sessionToken } = await AgentsEco.walletLogin({
  wallet: walletAddress,
  nonce: challenge.nonce,
  signature,
});

// 4. Create client with session token
const client = new AgentsEco({ apiKey: sessionToken });

API Reference

Constructor

new AgentsEco({
  apiKey: string;        // Required — API key or session token
  baseUrl?: string;      // Default: "https://agents.eco"
  timeout?: number;      // Default: 30000 (ms)
  headers?: Record<string, string>;  // Extra headers
  fetch?: typeof fetch;  // Custom fetch (for Node 16 or testing)
});

Auth (Static Methods)

| Method | Description | |--------|-------------| | AgentsEco.getChallenge(wallet, purpose) | Get a nonce challenge for wallet auth | | AgentsEco.register(data) | Register a new account | | AgentsEco.walletLogin(data) | Login with wallet signature | | AgentsEco.getSkills() | Get platform skills docs (public) |

Auth (Authenticated)

| Method | Description | |--------|-------------| | client.getProfile() | Get current user profile | | client.regenerateApiKey() | Regenerate API key (invalidates current) |

Wallet

| Method | Description | |--------|-------------| | client.getBalance() | Get USDC balance | | client.getDepositAddress() | Get vault address for deposits | | client.verifyDeposit({ txHash }) | Verify and credit an on-chain deposit |

Agents

| Method | Description | |--------|-------------| | client.getAgentConfig() | Get creation pricing | | client.listAgents() | List all your agents | | client.createAgent(data) | Create a new agent | | client.getAgent(id) | Get agent details + runs | | client.chat(id, message) | Chat with an agent | | client.updateAgent(id, data) | Update agent settings | | client.deleteAgent(id) | Delete an agent |

Inference

| Method | Description | |--------|-------------| | client.infer(data, idempotencyKey?) | Run model inference | | client.getInferenceStatus(requestId) | Get inference result |

Billing

| Method | Description | |--------|-------------| | client.getLedger({ limit?, offset?, type? }) | Get transaction history | | client.getReceipts({ limit?, offset? }) | Get billing receipts |

Models

| Method | Description | |--------|-------------| | client.listModels({ limit?, offset?, task? }) | List available models | | client.registerModel(data) | Register a new model |

Providers

| Method | Description | |--------|-------------| | client.getProviders() | Get provider status + models |

Error Handling

import { AgentsEco, AgentsEcoError } from "@agents-eco/sdk";

try {
  await client.chat("invalid-id", "hello");
} catch (err) {
  if (err instanceof AgentsEcoError) {
    console.error(`API Error ${err.status}: ${err.message}`);
    // err.body contains the full error response
  }
}

Examples

Deposit and Create Agent

const client = new AgentsEco({ apiKey: "ak_..." });

// Get deposit address
const { vaultAddress, chainName } = await client.getDepositAddress();
console.log(`Send USDC to ${vaultAddress} on ${chainName}`);

// After sending USDC on-chain, verify the deposit
const deposit = await client.verifyDeposit({ txHash: "0x..." });
console.log(`Credited: ${(Number(deposit.amountUsdc) / 1e6).toFixed(2)} USDC`);

// Create agent
const agent = await client.createAgent({
  name: "My Bot",
  systemPrompt: "You are a helpful assistant.",
  memoryEnabled: true,
  reasoningEnabled: true,
});

// Chat
const res = await client.chat(agent.id, "Hello!");
console.log(res.response);

Run Raw Inference

const result = await client.infer({
  modelId: "qwen-3b",
  input: { messages: [{ role: "user", content: "Explain quantum computing" }] },
});
console.log(result.output);
console.log(`Cost: ${(Number(result.costCredits) / 1e6).toFixed(6)} USDC`);

List Transactions

const ledger = await client.getLedger({ limit: 10 });
for (const entry of ledger.entries) {
  const usd = (Number(entry.amountCredits) / 1e6).toFixed(4);
  console.log(`${entry.type}: $${usd} — ${entry.createdAt}`);
}

License

MIT