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

opencode-puter-setup

v1.0.0

Published

Auto-configure Puter as an OpenCode provider — Claude Sonnet 4.6 with prompt caching, free

Downloads

200

Readme

opencode-puter-setup

Auto-configure Puter as an OpenCode provider, giving you access to Claude Sonnet 4.6 for free — with optional prompt caching.

What This Does

  • Adds two Puter provider entries to your OpenCode config
  • Stores your Puter auth token in the OpenCode auth file
  • Zero external dependencies beyond Node.js 18+

| Provider entry | Model | Endpoint | Prompt caching | |---|---|---|---| | puter-openai | Claude Sonnet 4.6 (Puter) | OpenAI-compatible | No | | puter-anthropic | Claude Sonnet 4.6 — Cached (Puter) | Anthropic-wire | Message-level only |

Caching limitation: Puter's Anthropic endpoint normalises system prompts to plain strings, which strips cache_control. Caching works on user/assistant message content, but not on system prompts.

Installation

# No install required
npx opencode-puter-setup

# Or install globally
npm install -g opencode-puter-setup
opencode-puter-setup

Quick Start

  1. Get your token at https://puter.com → Settings → API Tokens
  2. Run the setup and paste it in when prompted
  3. Restart OpenCode, run /models, and select either Puter model

What Gets Written

~/.config/opencode/opencode.json (or local .opencode/config.json):

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "puter-openai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Puter",
      "options": {
        "baseURL": "https://api.puter.com/puterai/openai/v1/"
      },
      "models": {
        "anthropic/claude-sonnet-4-6": {
          "name": "Claude Sonnet 4.6 (Puter)"
        }
      }
    },
    "puter-anthropic": {
      "npm": "@ai-sdk/anthropic",
      "name": "Puter (Cached)",
      "options": {
        "baseURL": "https://api.puter.com/puterai/anthropic/v1/",
        "apiKey": "puter"
      },
      "models": {
        "anthropic/claude-sonnet-4-6": {
          "name": "Claude Sonnet 4.6 — Cached (Puter)"
        }
      }
    }
  }
}

~/.local/share/opencode/auth.json — token stored with 0600 permissions.

Billing

Puter uses a user-pays model. Your free tier covers typical usage. No charges to you as the developer.

Troubleshooting

Model not showing in /models — restart OpenCode after setup.

401 errors — your token may have expired. Re-run the setup with a fresh token.

Caching not reducing costs — system prompt caching is not supported through Puter. Use message-level cache_control on large repeated user/assistant content instead.

License

MIT