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

@openpets/opencode-zen

v1.0.0

Published

Access OpenCode Zen's curated AI models through multiple API endpoints including chat completions, messages, responses, and model discovery

Readme

OpenCode Zen Pet Plugin

Comprehensive OpenCode Zen API integration for OpenCode. Access 24+ curated AI models through multiple API endpoints including chat completions, messages, responses, and model discovery.

Features

  • Model Discovery: List all available OpenCode Zen models with metadata
  • Multiple API Endpoints: Support for chat completions, messages, responses, and Gemini-specific endpoints
  • Free Model Filtering: Easily identify and use free models
  • Model Information: Get detailed information about specific models
  • Read-Only Mode: Safe operation when write restrictions are needed
  • Connection Testing: Verify API connectivity and configuration

Quick Start

1. Get Your API Token

  1. Go to OpenCode Zen Auth
  2. Sign in and add your billing details
  3. Copy your API key

2. Configure Environment

Create .env file in the plugin directory:

OPENCODE_ZEN_TOKEN=your_api_token_here

Or set the environment variable:

export OPENCODE_ZEN_TOKEN=your_api_token_here

3. Test Connection

cd pets/opencode-zen
opencode run "test OpenCode Zen connection" --format json --print-logs

Available Tools

Connection & Discovery

  • opencode-zen-test-connection - Test API connectivity
  • opencode-zen-list-models - List available models (supports free-only filtering)
  • opencode-zen-get-model-info - Get detailed information about a specific model

Content Generation

  • opencode-zen-chat-completion - OpenAI-compatible chat completions
  • opencode-zen-create-response - GPT-specific responses API
  • opencode-zen-create-message - Claude-compatible messages API
  • opencode-zen-generate-gemini - Google Gemini content generation

Model Categories

OpenAI Models (Responses API)

  • gpt-5.2, gpt-5.1, gpt-5.1-codex, gpt-5.1-codex-max, gpt-5.1-codex-mini, gpt-5, gpt-5-codex, gpt-5-nano

Anthropic Models (Messages API)

  • claude-sonnet-4.5, claude-sonnet-4, claude-haiku-4.5, claude-3-5-haiku, claude-opus-4.5, claude-opus-4.1

Google Models (Gemini API)

  • gemini-3-pro, gemini-3-flash

OpenAI-Compatible Models (Chat Completions)

  • glm-4.6, glm-4.7-free, kimi-k2, kimi-k2-thinking, qwen3-coder, grok-code, big-pickle

Free Models (Limited Time)

  • big-pickle, grok-code, glm-4.7, minimax-m2.1, gpt-5-nano

Usage Examples

List All Models

opencode run "list available OpenCode Zen models"

List Only Free Models

opencode run "list only free models"

Create Chat Completion

opencode run "create a chat completion using glm-4.7 model with messages: [role: user, content: Hello, how are you?]"

Generate with Claude

opencode run "create a message using claude-sonnet-4-5 model with system: You are a helpful assistant and messages: [role: user, content: Explain quantum computing]"

Use GPT Responses API

opencode run "create a response using gpt-5.1-codex model with input: Write a Python function to calculate factorial"

Generate with Gemini

opencode run "generate content with gemini-3-pro with contents: [parts: [text: What is machine learning?]]"

Get Model Information

opencode run "get details about claude-sonnet-4-5"

Configuration Options

The plugin supports various parameters for content generation:

  • temperature: Control randomness (0.0-2.0)
  • maxTokens: Limit response length
  • stream: Enable streaming responses
  • topP: Nucleus sampling parameter
  • system: System prompts (for compatible models)
  • tools: Function calling (for supported models)

Read-Only Mode

The plugin respects OpenPets read-only mode settings:

# Enable read-only mode
pets read-only opencode-zen on

# Disable read-only mode  
pets read-only opencode-zen off

# Check status
pets read-only --status

Pricing

OpenCode Zen uses pay-as-you-go pricing. Rates per 1M tokens:

  • Free Models: Big Pickle, Grok Code, GLM 4.7, MiniMax M2.1, GPT 5 Nano
  • Budget Models: GLM 4.6 ($0.60 input), Kimi K2 ($0.40 input), Qwen3 Coder ($0.45 input)
  • Premium Models: Claude Sonnet 4.5 ($3.00 input), GPT 5.2 ($1.75 input), Gemini 3 Pro ($2.00 input)

See the OpenCode Zen documentation for complete pricing details.

Development Scripts

# Build the plugin
npm run build

# Test connection
npm run test:connection

# List models
npm run test:models

# Test free models
npm run test:free

# Quick start demo
npm run quickstart

Troubleshooting

Connection Issues

  • Verify your OPENCODE_ZEN_TOKEN is set correctly
  • Check that you have added billing details to your OpenCode Zen account
  • Ensure your token has sufficient credits

Model Not Found

  • Use the list-models tool to see available model IDs
  • Check that you're using the correct model ID format
  • Some models may be temporarily unavailable

Rate Limiting

  • Free models may have rate limits during beta
  • Premium models provide better performance and higher limits
  • Consider upgrading your account for increased usage

Support

Privacy

All models are hosted in the US with zero-retention policies (except OpenAI and Anthropic APIs which retain requests for 30 days). Some free models may use data for improvement during their beta period.


Built with ❤️ for the OpenCode ecosystem