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

goldbean-client

v0.1.0

Published

Official GoldBean SDK — One client for 7 Chinese LLM providers

Readme

GoldBean Client SDK

One client for 7 Chinese LLM providers.

npm install goldbean-client

Quick Start

const { createClient } = require('goldbean-client');

const gb = createClient('your-api-key');

// Simple ask
const response = await gb.ask('deepseek-v4-pro', 'Explain quantum computing in 3 sentences');
console.log(response.content);

// Full chat
const result = await gb.chat({
  model: 'kimi-k2.6',
  messages: [
    { role: 'system', content: 'You are a helpful assistant.' },
    { role: 'user', content: 'Write a Python function to reverse a linked list.' }
  ],
  maxTokens: 2000
});
console.log(result.content);
console.log(result.usage.total_tokens);

Supported Providers

| Provider | Models | Endpoint | |----------|--------|----------| | DeepSeek | V4-Pro, V4-Flash | /ai/ds/chat, /ai/ds/flash | | Kimi (Moonshot) | K2.6, K2.7-Code | /ai/kimi/chat, /ai/kimi/code | | Doubao (ByteDance) | Pro, Mini, Lite | /ai/doubao/chat, /ai/doubao/mini, /ai/doubao/lite | | Qwen (Alibaba) | Max, Turbo, Plus | /ai/qwen/chat, /ai/qwen/turbo, /ai/qwen/plus | | Hunyuan (Tencent) | Pro | /ai/hy3/chat | | ERNIE (Baidu) | 4.0 | /paid/baidu-llm-chat | | GLM (Zhipu) | 4 | /ai/glm/chat |

API Key

Get your API key at goldbean-api.xyz:

  • Free: 2000 calls/day without signup
  • Paid: From $5 for 100 calls (no expiry)

Methods

chat(params)

Send a chat completion request.

const response = await gb.chat({
  model: 'deepseek-v4-pro',    // Required
  messages: [                   // Required
    { role: 'user', content: 'Hello' }
  ],
  temperature: 0.7,            // Optional (ignored for Kimi, fixed at 1)
  maxTokens: 1000,             // Optional
});

ask(model, message, options)

Simple one-shot ask.

const response = await gb.ask('deepseek-v4-pro', 'What is 2+2?');

getModels(provider?)

List available models.

const models = await gb.getModels(); // All models
const deepseekModels = await gb.getModels('deepseek'); // Provider-specific

health(provider)

Check provider health.

const health = await gb.health('deepseek');

Response Format

{
  content: "The assistant's response text",
  provider: "deepseek",
  model: "deepseek-v4-pro",
  usage: {
    prompt_tokens: 12,
    completion_tokens: 56,
    total_tokens: 68
  },
  finishReason: "stop",
  raw: { /* full API response */ }
}

Error Handling

try {
  const response = await gb.chat({ model: 'unknown-model', messages: [] });
} catch (err) {
  console.error(err.message); // "Unknown model: unknown-model"
}

Retry Logic

The SDK automatically retries on:

  • 429 Too Many Requests
  • 5xx Server Errors
  • Network errors

Default: 2 retries with exponential backoff.

License

MIT © GoldBean