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

@vitorcen/ccr-multi-key

v1.0.49-dev

Published

Use Claude Code without an Anthropics account and route it to another LLM provider

Readme

中文 README

Claude Code Router (fork)

Forked from: https://github.com/musistudio/claude-code-router

This fork focuses on provider key rotation and per-key metrics/diagnostics:

  • Multi-key rotation per provider (advance only on success)
  • Per-key usage stats written back to the config file: req_count, req_tokens, rsp_tokens
  • Per-key error recording: err_code, err_msg (e.g., 401/403)
  • Global --config CLI option supported for all commands (start, code, ui, …)
  • 4xx (non-429) failures won’t rotate key within the same request, allowing client/system retries to surface visibly in UI

Installation

npm install -g @vitorcen/ccr-multi-key

CLI

  • Use a custom config file anywhere in command: ccrm -c /path/to/config.json code "..." or ccrm code --config=/path/to/config.json "..."
  • The router will write metrics back to that same file.

Quick config example (no stats fields)

{
  "Providers": [
    {
      "name": "gemini",
      "api_base_url": "https://generativelanguage.googleapis.com/v1beta/models/",
      "api_keys": [
        { "name": "free_tier1", "key": "sk-..." },
        { "name": "free_tier2", "key": "sk-..." },
        { "name": "free_tier3", "key": "sk-..." }
      ]
    }
  ],
  "Router": {
    "default": "gemini,gemini-2.5-pro"
  }
}

Stats fields example (written back by the router)

{
  "Providers": [
    {
      "name": "gemini",
      "api_keys": [
        {
          "name": "free_tier1",
          "key": "sk-...",
          "req_count": 3,
          "req_tokens": 74196,
          "rsp_tokens": 695,
          "req_today": 3,
          "last_req_ts": 1727000000,
          "err_code": 0,
          "err_msg": ""
        },
        {
          "name": "free_tier2",
          "key": "sk-...",
          "req_count": 2,
          "req_tokens": 1580,
          "rsp_tokens": 0,
          "req_today": 2,
          "last_req_ts": 1727000000,
          "err_code": 401,
          "err_msg": "Error from provider(,... 401): No auth credentials found"
        },
        {
          "name": "free_tier3",
          "key": "sk-...",
          "req_count": 1,
          "req_tokens": 980,
          "rsp_tokens": 120,
          "req_today": 1,
          "last_req_ts": 1727000000,
          "err_code": 0,
          "err_msg": ""
        }
      ]
    }
  ]
}

Gemini API rate limits (official)

Important: Gemini rate limits are applied per project, not per API key. “Free tier x3” only aggregates if you use three separate projects (and thus three independent quotas). If all keys belong to the same project, quotas do NOT add up.

Gemini 2.5 Pro (text-out) — Free vs Free x3 vs Tier 1

| Limit Type | Free Tier | Free Tier ×3 | Tier 1 | | --------------------------- | ----------: | --------------: | ----------: | | RPM (requests per minute) | 5 | 15 | 150 | | TPM (tokens per minute) | 250,000 | 750,000 | 2,000,000 | | RPD (requests per day) | 100 | 300 | 10,000 |

Gemini 2.5 Flash (text-out) — Free vs Free x3 vs Tier 1

| Limit Type | Free Tier | Free Tier ×3 | Tier 1 | | --------------------------- | ----------: | --------------: | ----------: | | RPM (requests per minute) | 10 | 30 | 1,000 | | TPM (tokens per minute) | 250,000 | 750,000 | 1,000,000 | | RPD (requests per day) | 250 | 750 | 10,000 |

Notes:

Notes on using multiple keys / rotation (Gemini)

  • Limits are per project, not per API key. Rotating several keys of the same project will NOT increase effective RPM/TPM/RPD.

  • Aggregating “Free ×3” only works if the keys belong to three separate projects (hence three independent quotas). Even then, Google states that rate limits are “not guaranteed and actual capacity may vary,”.

  • Recommended path: upgrade your tier, request rate limit increases, or shard traffic across truly independent projects that meet Google’s policies.

    • Rate limits: https://ai.google.dev/gemini-api/docs/rate-limits
    • Additional usage policies: https://ai.google.dev/gemini-api/docs/usage-policies
  • Free/Tier 1 numbers vary by model; tables above show the two most common text-out models.

  • Some models have additional dimensions (e.g., sessions for Live API, image/minute for Imagen). See the official table for details.

  • Use a custom config file anywhere in command: ccr --config /path/to/config.json code "..." or ccr code --config=/path/to/config.json "..."

  • The router will write metrics back to that same file.