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

zephyrcode

v3.0.0

Published

Official JavaScript SDK for ZephyrCode — the AI coding agent platform

Downloads

1,113

Readme

ZephyrCode JavaScript SDK

Official JavaScript SDK for ZephyrCode — the AI coding agent platform

npm version Node 16+ License: MIT


Installation

npm i zephyrcode

Note: This is a closed-source, proprietary SDK. There is no public repository. For support, email [email protected].

Quickstart

1. Get an API key

Create one at zephyrcode.space-z.ai/apikey. Your key will look like:

zephyr-yourname-aBcD123eFgH456...

2. Stream a chat completion

const { ZephyrCode } = require("zephyrcode");

const client = new ZephyrCode({ apiKey: "zephyr-yourname-xxx" });

(async () => {
  for await (const chunk of client.chat.stream({
    message: "Build a React login form with Tailwind CSS",
    model: "z-code-ultra",
    mode: "code",
  })) {
    if (chunk.type === "content") {
      process.stdout.write(chunk.delta);
    } else if (chunk.type === "done") {
      console.log(`\n\n✅ Done — tools used: ${chunk.toolsUsed}`);
    }
  }
})();

3. Non-streaming response

const response = await client.chat.create({
  message: "Explain async/await in JavaScript",
  model: "z-code-pro",
});
console.log(response.content);
console.log(`Reasoning steps: ${response.reasoning.length}`);
console.log(`Tool calls: ${response.toolCalls.length}`);

API Reference

new ZephyrCode({ apiKey, baseUrl, timeout })

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | apiKey | string | required | Your zephyr-{username}-{secret} key | | baseUrl | string | https://zephyrcode.space-z.ai | API base URL | | timeout | number | 60000 | Request timeout in ms |


client.chat.stream(params) — AsyncIterable

Stream a chat completion as Server-Sent Events.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | message | string | — | A single user message | | messages | Message[] | — | Full conversation history | | model | string | "z-code-ultra" | Model ID | | mode | string | "code" | Mode | | thinking | boolean | true | Enable extended reasoning | | projectContext | object | — | {language, framework, files} |

Yields event objects with .type:

| Type | Description | |------|-------------| | meta | Stream start — model + mode info | | plan | Task decomposition with steps | | reasoning | Chain-of-thought chunk | | tool_call | Agent invokes a tool | | tool_result | Structured tool output | | content | Markdown content delta (.delta) | | done | Terminal event with stats | | error | Fatal error (throws StreamError) |


client.chat.create(params) → Promise<ChatResponse>

Same parameters as .stream(), returns { content, model, mode, toolsUsed, fallbackUsed, reasoning, toolCalls, plan }.


client.tts.create({ text, voice, speed, translate, targetLanguage }) → Promise<TTSResponse>

const audio = await client.tts.create({
  text: "Hello, welcome to ZephyrCode!",
  voice: "rachel",
  speed: 1.0,
});
require("fs").writeFileSync("welcome.wav", audio.audio);

client.apikeys — API Key Management

const keys = await client.apikeys.list();
const newKey = await client.apikeys.create({
  name: "Production",
  permissions: "all",        // "all", "restricted", "readonly"
  expiration: "60d",         // "1d", "3d", "7d", "21d", "60d", "never"
  credit: 100.0,
  project: "My App",
});
await client.apikeys.revoke(newKey.id);
await client.apikeys.delete(newKey.id);

client.projects — Project Management

const projects = await client.projects.list();
const project = await client.projects.create("My App");
await client.projects.delete(project.id);

client.models — Model Information

const models = await client.models.list();
models.forEach((m) => console.log(`${m.id} — ${m.label}`));

Models

| Model | ID | Best for | |-------|----|----------| | Z Code Ultra | z-code-ultra | Frontier reasoning, multi-file refactors | | Z Code Pro | z-code-pro | Everyday coding, quick fixes | | Z Code Local | z-code-local | On-device, privacy-first |

Error Handling

const { ZephyrCode, AuthenticationError, RateLimitError, APIError, StreamError } = require("zephyrcode");

try {
  const response = await client.chat.create({ message: "Hello" });
} catch (e) {
  if (e instanceof AuthenticationError) {
    console.log("Invalid API key");
  } else if (e instanceof RateLimitError) {
    console.log(`Rate limited. Retry after ${e.retryAfter}s`);
  } else if (e instanceof APIError) {
    console.log(`API error (${e.statusCode}): ${e.message}`);
  } else if (e instanceof StreamError) {
    console.log(`Stream error: ${e.message}`);
  }
}

Automatic Retries

The SDK automatically retries on 502, 503, 504 status codes and connection errors — up to 3 times with exponential backoff (1s, 2s, 4s). This handles intermittent gateway errors transparently.

ESM Import

import { ZephyrCode } from "zephyrcode";

CommonJS Require

const { ZephyrCode } = require("zephyrcode");

License

Proprietary © ZephyrCode Labs. This SDK is closed-source. All rights reserved.

Links