[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78E0TGCAMNPS207BA3G07S7":3,"skill-same:01M78E0TGCAMNPS207BA3G07S7":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":14,"repositoryHtmlUrl":32,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M78E0TGCAMNPS207BA3G07S7","zkrouter",null,"Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.","Solizardking\u002Fskillhub-main","Solizardking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108096810?v=4","01M786KDB10AYV042N0F9BD5B5","Clawd","01M786NYYXSZK1D05WM8JQPC48",0,"MIT","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzkrouter\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: zkrouter\ndescription: Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.\nhomepage: https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fzk-router\nmetadata:\n  emoji: \"🔀\"\n  requires:\n    config: []\n---\n\n# zk-router\n\nSelf-hosted LLM router. Sits between your OpenAI-compatible client and OpenRouter. On every request, it:\n\n1. **Classifies** the request with a 14-dimension weighted scoring engine (free, \u003C 1ms)\n2. **Detects mode overrides** (`\u002Fmax`, `\u002Fcomplex`, `[simple]`, etc.)\n3. **Stamps the routing decision** into a ZK compressed-state Merkle root\n4. **Forwards** to the chosen model on OpenRouter\n5. **Tracks** stats (requests, errors, savings, per-tier \u002F per-model breakdown)\n\nThe killer feature: **the Birth bot** auto-provisions a sponsored OpenRouter key on first boot, so a fresh install needs zero configuration. No env vars. No signup. No credit card.\n\n## Install\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fzk-router.git\ncd zk-router\nnpm install\nnpm run build\nnpm start\n```\n\nThe first `npm start` will:\n\n1. Load or create your Solana wallet at `~\u002F.zk-router\u002Fwallet.json` (mode 0600)\n2. Initialize the ZK journal at `~\u002F.zk-router\u002Fzk\u002F`\n3. Call the x402.wtf control plane to mint a sponsored OpenRouter key\n4. Bind that key to your wallet and persist it at `~\u002F.zk-router\u002Fbirth\u002Freceipt.json`\n5. Start the proxy on `http:\u002F\u002F127.0.0.1:18800`\n\nSubsequent boots reuse the cached receipt with no network call.\n\n## Quick Start\n\n```bash\n# 1. Start the router\nnpm start\n# 🌅 birth: provisioned key sk-or-v1-ab… (fresh)\n# zk-router proxy listening on http:\u002F\u002F127.0.0.1:18800\n\n# 2. Point any OpenAI-compatible client at it\ncurl http:\u002F\u002F127.0.0.1:18800\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"zkrouter\u002Fauto\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"What is 2+2?\"}]\n  }'\n```\n\n## Routing Tiers\n\n| Tier          | Example queries                                            | Default model                  | Cost (output \u002F M) |\n| ------------- | ---------------------------------------------------------- | ------------------------------ | ------------------ |\n| **SIMPLE**    | \"What is 2+2?\", \"Translate hello\", \"Yes or no\"            | `google\u002Fgemini-2.5-flash`       | $2.50              |\n| **MEDIUM**    | Summaries, explanations, simple code                     | `deepseek\u002Fdeepseek-chat`        | $1.10              |\n| **COMPLEX**   | Multi-step code, system design, agentic tasks             | `anthropic\u002Fclaude-sonnet-4.5`  | $15.00             |\n| **REASONING** | Proofs, math, multi-step logic                            | `openai\u002Fo3`                     | $40.00             |\n\nRules handle 100% of requests in \u003C 1ms with zero LLM cost.\n\n## Mode Overrides\n\nForce a tier with a prefix — the LLM never sees it:\n\n```bash\n# Slash prefix\n\u002Fsimple What's 2+2?\n\u002Fmax Refactor this distributed system\n\u002Freasoning Prove sqrt(2) is irrational\n\u002Fcomplex [simple]   # bracket prefix (alias names work too)\n\n# Word prefix\ndeep mode: Why does this recursive CTE produce duplicates?\nbasic mode, What time is it in Tokyo?\n\n# Aliases\nsimple, basic, cheap              → SIMPLE\nmedium, balanced                  → MEDIUM\ncomplex, advanced                 → COMPLEX\nmax, reasoning, think, deep      → REASONING\n```\n\nSee `GET \u002Fv1\u002Fmode-aliases` for the full list.\n\n## ZK-Stamped Routing\n\nEvery routing decision is appended to a Merkle tree in the ZK journal:\n\n```bash\ncurl http:\u002F\u002F127.0.0.1:18800\u002Fv1\u002Frelay\u002Fzk | jq .\n```\n\nEach chat completion response includes:\n\n```\nX-ZK-Router-Model:       google\u002Fgemini-2.5-flash\nX-ZK-Router-Tier:         SIMPLE\nX-ZK-Router-Savings:      97%\nX-ZK-Router-Reasoning:    score=-0.050 | short (8 tokens)\nX-ZK-Router-Root:         0x…\nX-ZK-Router-Index:        42\n```\n\nThe root is the Merkle root after appending this call's receipt. Auditors can verify the chain by replaying the routing decisions against the local classifier.\n\n## Endpoints\n\n| Endpoint                       | Auth   | Description                                              |\n| ------------------------------ | ------ | -------------------------------------------------------- |\n| `POST \u002Fv1\u002Fchat\u002Fcompletions`    | -      | OpenAI-compatible chat (model = `zkrouter\u002Fauto` or alias) |\n| `GET  \u002Fv1\u002Fmodels`              | -      | List available models + aliases                         |\n| `GET  \u002Fv1\u002Fmode-aliases`        | -      | List mode-override aliases                              |\n| `GET  \u002Fv1\u002Frelay\u002Fzk`            | -      | ZK primitives snapshot                                  |\n| `GET  \u002Fhealth`                  | -      | Health + uptime + stats                                 |\n| `GET  \u002Fstats`                   | -      | Full request statistics (per-tier, per-model, costs)   |\n| `GET  \u002Fconfig`                  | -      | Sanitized config + routing version                      |\n| `POST \u002Freload-config`           | -      | Hot-reload `zkrouter.config.json`                       |\n| `GET  \u002Fv1\u002Fadmin\u002Fstatus`        | admin  | Operator status: kill switch, tier override, audit queue |\n| `POST \u002Fv1\u002Fadmin\u002Fkill-switch`   | admin  | Toggle the kill switch (refuse all `\u002Fv1\u002Fchat`)         |\n| `GET  \u002Fv1\u002Fadmin\u002Faudit`         | admin  | Last 100 routing decisions (incl. blocked)              |\n| `POST \u002Fv1\u002Fadmin\u002Fforce-birth`   | admin  | Wipe receipt and re-provision a fresh OpenRouter key   |\n| `POST \u002Fv1\u002Fadmin\u002Fset-tier-override` | admin | Pin a tier for the next N requests                    |\n| `POST \u002Fv1\u002Fadmin\u002Freload-config` | admin  | Re-read `zkrouter.config.json` + reload env secret     |\n\n### Admin auth\n\nAll `\u002Fv1\u002Fadmin\u002F*` endpoints require `Authorization: Bearer \u003CCLAWDROUTER_ADMIN_SECRET>`.\nIf the env var is unset, all admin endpoints return **503 not_configured** (defense in depth).\n\n```bash\n# Status\ncurl -H \"Authorization: Bearer $CLAWDROUTER_ADMIN_SECRET\" \\\n  http:\u002F\u002Flocalhost:18800\u002Fv1\u002Fadmin\u002Fstatus\n\n# Activate kill switch with 60s TTL\ncurl -X POST -H \"Authorization: Bearer $CLAWDROUTER_ADMIN_SECRET\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"reason\":\"investigating abuse\",\"ttlSec\":60}' \\\n  http:\u002F\u002Flocalhost:18800\u002Fv1\u002Fadmin\u002Fkill-switch\n\n# Force the next 10 requests to use the REASONING tier\ncurl -X POST -H \"Authorization: Bearer $CLAWDROUTER_ADMIN_SECRET\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"tier\":\"REASONING\",\"requests\":10}' \\\n  http:\u002F\u002Flocalhost:18800\u002Fv1\u002Fadmin\u002Fset-tier-override\n\n# Audit the last 100 routing decisions\ncurl -H \"Authorization: Bearer $CLAWDROUTER_ADMIN_SECRET\" \\\n  http:\u002F\u002Flocalhost:18800\u002Fv1\u002Fadmin\u002Faudit\n\n# Rotate the admin secret without a restart\nexport CLAWDROUTER_ADMIN_SECRET=new-secret\ncurl -X POST -H \"Authorization: Bearer $CLAWDROUTER_ADMIN_SECRET\" \\\n  http:\u002F\u002Flocalhost:18800\u002Fv1\u002Fadmin\u002Freload-config\n```\n\n## Configuration\n\n`zkrouter.config.json` is looked up in this order:\n\n1. `$ZKROUTER_CONFIG` env var\n2. `.\u002Fzkrouter.config.json` (cwd)\n3. `~\u002F.config\u002Fzk-router\u002Fconfig.json`\n\nIf no file is found, built-in defaults apply. Edit to override the tier→model mapping:\n\n```json\n{\n  \"port\": 18800,\n  \"host\": \"127.0.0.1\",\n  \"logLevel\": \"info\",\n  \"openRouterBaseUrl\": \"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\",\n  \"tiers\": {\n    \"SIMPLE\":  { \"primary\": \"google\u002Fgemini-2.5-flash\",     \"fallback\": [\"deepseek\u002Fdeepseek-chat\"] },\n    \"MEDIUM\":  { \"primary\": \"deepseek\u002Fdeepseek-chat\",      \"fallback\": [\"anthropic\u002Fclaude-haiku-4.5\"] },\n    \"COMPLEX\": { \"primary\": \"anthropic\u002Fclaude-sonnet-4.5\", \"fallback\": [\"openai\u002Fgpt-4o-mini\"] },\n    \"REASONING\": { \"primary\": \"openai\u002Fo3\",                \"fallback\": [\"anthropic\u002Fclaude-opus-4.5\"] }\n  }\n}\n```\n\n## Environment Variables\n\n| Variable                          | Default | Description                                  |\n| --------------------------------- | ------- | -------------------------------------------- |\n| `OPENROUTER_API_KEY`              | -       | Skip the Birth bot; use this key directly.   |\n| `CLAWDROUTER_ADMIN_SECRET`        | -       | Bearer secret for `\u002Fv1\u002Fadmin\u002F*` (kill switch, force-birth, audit). Required for admin ops. |\n| `ZKROUTER_PORT`                   | `18800` | Server port                                  |\n| `ZKROUTER_HOST`                   | `127.0.0.1` | Bind address                              |\n| `ZKROUTER_LOG_LEVEL`              | `info`  | `debug` \u002F `info` \u002F `warn` \u002F `error` \u002F `silent` |\n| `ZKROUTER_BIRTH_ENABLED`          | `true`  | Master switch for the Birth bot             |\n| `ZKROUTER_BIRTH_CONTROL_PLANE_URL` | `https:\u002F\u002Fx402.wtf` | Control plane base URL             |\n| `ZKROUTER_BIRTH_VAULT_DIR`        | `~\u002F.zk-router\u002Fbirth` | Receipt directory                |\n| `ZKROUTER_BIRTH_AUTO_TRIGGER`     | `true`  | Run Birth on startup                       |\n| `ZKROUTER_BIRTH_TIMEOUT_MS`       | `8000`  | HTTP timeout for the control plane         |\n| `ZKROUTER_ZK_ENABLED`             | `true`  | Master switch for ZK                        |\n| `ZKROUTER_ZK_STORAGE_DIR`         | `~\u002F.zk-router\u002Fzk` | ZK journal directory                  |\n| `ZKROUTER_ZK_TREE_DEPTH`          | `20`    | Merkle tree depth (8 \u002F 16 \u002F 20 \u002F 26)        |\n\n## The 14-Dimension Classifier\n\n| Dimension            | Weight | Detection                                |\n| -------------------- | ------ | ---------------------------------------- |\n| Reasoning markers    | 0.25   | \"prove\", \"theorem\", \"step by step\"       |\n| Technical terms      | 0.18   | \"algorithm\", \"kubernetes\", \"distributed\" |\n| Code presence        | 0.12   | \"function\", \"async\", \"import\", \"```\"     |\n| Multi-step patterns  | 0.12   | \"first...then\", \"step 1\"                 |\n| Domain specificity   | 0.12   | \"quantum\", \"fpga\", \"zero-knowledge\"     |\n| Simple indicators    | 0.10   | \"what is\", \"define\", \"translate\"         |\n| Imperative verbs     | 0.06   | \"build\", \"create\", \"implement\"           |\n| Token count          | 0.04   | short (\u003C 50) vs long (> 500)             |\n| Agentic task         | 0.04   | \"read file\", \"edit\", \"run\", \"test\"       |\n| Creative markers     | 0.05   | \"story\", \"poem\", \"brainstorm\"            |\n| Question complexity  | 0.05   | Multiple question marks                  |\n| Constraint count     | 0.04   | \"at most\", \"maximum\", \"limit\"            |\n| Output format        | 0.03   | \"json\", \"yaml\", \"schema\"                 |\n| Reference complexity | 0.02   | \"above\", \"the docs\", \"the api\"           |\n| Negation complexity  | 0.01   | \"don't\", \"avoid\", \"without\"              |\n\nThe weighted score maps to a tier via configurable boundaries. Confidence is calibrated using a sigmoid function. **> 2 reasoning markers** forces the REASONING tier at high confidence.\n\n## Cost Impact\n\n| Tier             | % of Traffic | Output $\u002FM   | Savings         |\n| ---------------- | ------------ | ------------ | --------------- |\n| SIMPLE           | 40%          | $2.50        | **97% cheaper** |\n| MEDIUM           | 30%          | $1.10        | **99% cheaper** |\n| COMPLEX          | 20%          | $15.00       | best quality    |\n| REASONING        | 10%          | $40.00       | **47% cheaper** |\n| **Weighted avg** |              | **~$11.50\u002FM** | **~70% savings** |\n\n(Calculated against Claude Opus 4.5 baseline at $75\u002FM output tokens.)\n\n## What makes this different\n\n| Feature                    | OpenRouter | LiteLLM | zk-router     |\n| -------------------------- | ---------- | ------- | ------------- |\n| Open source                | ❌         | ✅      | ✅            |\n| Smart tier routing         | ❌         | ❌      | ✅            |\n| Mode overrides             | ❌         | ❌      | ✅            |\n| **Free OpenRouter at install** | ❌   | ❌      | ✅ (Birth)    |\n| **ZK-stamped routing decisions** | ❌ | ❌   | ✅            |\n| Zero-config startup         | ❌         | ❌      | ✅            |\n| Multilingual classifier    | ✅         | ❌      | ✅            |\n| External config hot-reload | ❌         | ✅      | ✅            |\n| Agentic auto-detection     | ❌         | ❌      | ✅            |\n| Context-length-aware routing | ❌        | partial | ✅            |\n\n## Credits\n\n- **Smart router** — adapted from [BlockRunAI\u002FClawRouter](https:\u002F\u002Fgithub.com\u002FBlockRunAI\u002FClawRouter) → [FreeRouter](https:\u002F\u002Fgithub.com\u002Fopenfreerouter\u002Ffreerouter) (MIT)\n- **ZK primitives** — ported from [clawdrouter](https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fclawd-router) (MIT)\n- **Birth bot** — ported from [clawdrouter](https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fclawd-router) (MIT)\n- **OpenRouter integration** — uses the [OpenRouter Chat Completions API](https:\u002F\u002Fopenrouter.ai\u002Fdocs)\n- **Sponsored key provisioning** — powered by [x402.wtf](https:\u002F\u002Fx402.wtf) control plane\n\n## License\n\nMIT\n","# zk-router\n\nSelf-hosted LLM router. Sits between your OpenAI-compatible client and OpenRouter. On every request, it:\n\n1. **Classifies** the request with a 14-dimension weighted scoring engine (free, \u003C 1ms)\n2. **Detects mode overrides** (`\u002Fmax`, `\u002Fcomplex`, `[simple]`, etc.)\n3. **Stamps the routing decision** into a ZK compressed-state Merkle root\n4. **Forwards** to the chosen model on OpenRouter\n5. **Tracks** stats (requests, errors, savings, per-tier \u002F per-model breakdown)\n\nThe killer feature: **the Birth bot** auto-provisions a sponsored OpenRouter key on first boot, so a fresh install needs zero configuration. No env vars. No signup. No credit card.\n\n## Install\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fzk-router.git\ncd zk-router\nnpm install\nnpm run build\nnpm start\n```\n\nThe first `npm start` will:\n\n1. Load or create your Solana wallet at `~\u002F.zk-router\u002Fwallet.json` (mode 0600)\n2. Initialize the ZK journal at `~\u002F.zk-router\u002Fzk\u002F`\n3. Call the x402.wtf control plane to mint a sponsored OpenRouter key\n4. Bind that key to your wallet and persist it at `~\u002F.zk-router\u002Fbirth\u002Freceipt.json`\n5. Start the proxy on `http:\u002F\u002F127.0.0.1:18800`\n\nSubsequent boots reuse the cached receipt with no network call.\n\n## Quick Start\n\n```bash\n# 1. Start the router\nnpm start\n# 🌅 birth: provisioned key sk-or-v1-ab… (fresh)\n# zk-router proxy listening on http:\u002F\u002F127.0.0.1:18800\n\n# 2. Point any OpenAI-compatible client at it\ncurl http:\u002F\u002F127.0.0.1:18800\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"zkrouter\u002Fauto\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"What is 2+2?\"}]\n  }'\n```\n\n## Routing Tiers\n\n| Tier          | Example queries                                            | Default model                  | Cost (output \u002F M) |\n| ------------- | ---------------------------------------------------------- | ------------------------------ | ------------------ |\n| **SIMPLE**    | \"What is 2+2?\", \"Translate hello\", \"Yes or no\"            | `google\u002Fgemini-2.5-flash`       | $2.50              |\n| **MEDIUM**    | Summaries, explanations, simple code                     | `deepseek\u002Fdeepseek-chat`        | $1.10              |\n| **COMPLEX**   | Multi-step code, system design, agentic tasks             | `anthropic\u002Fclaude-sonnet-4.5`  | $15.00             |\n| **REASONING** | Proofs, math, multi-step logic                            | `openai\u002Fo3`                     | $40.00             |\n\nRules handle 100% of requests in \u003C 1ms with zero LLM cost.\n\n## Mode Overrides\n\nForce a tier with a prefix — the LLM never sees it:\n\n```bash\n# Slash prefix\n\u002Fsimple What's 2+2?\n\u002Fmax Refactor this distributed system\n\u002Freasoning Prove sqrt(2) is irrational\n\u002Fcomplex [simple]   # bracket prefix (alias names work too)\n\n# Word prefix\ndeep mode: Why does this recursive CTE produce duplicates?\nbasic mode, What time is it in Tokyo?\n\n# Aliases\nsimple, basic, cheap              → SIMPLE\nmedium, balanced                  → MEDIUM\ncomplex, advanced                 → COMPLEX\nmax, reasoning, think, deep      → REASONING\n```\n\nSee `GET \u002Fv1\u002Fmode-aliases` for the full list.\n\n## ZK-Stamped Routing\n\nEvery routing decision is appended to a Merkle tree in the ZK journal:\n\n```bash\ncurl http:\u002F\u002F127.0.0.1:18800\u002Fv1\u002Frelay\u002Fzk | jq .\n```\n\nEach chat completion response includes:\n\n```\nX-ZK-Router-Model:       google\u002Fgemini-2.5-flash\nX-ZK-Router-Tier:         SIMPLE\nX-ZK-Router-Savings:      97%\nX-ZK-Router-Reasoning:    score=-0.050 | short (8 tokens)\nX-ZK-Router-Root:         0x…\nX-ZK-Router-Index:        42\n```\n\nThe root is the Merkle root after appending this call's receipt. Auditors can verify the chain by replaying the routing decisions against the local classifier.\n\n## Endpoints\n\n| Endpoint                       | Auth   | Description                                              |\n| ------------------------------ | ------ | -------------------------------------------------------- |\n| `POST \u002Fv1\u002Fchat\u002Fcompletions`    | -      | OpenAI-compatible chat (model = `zkrouter\u002Fauto` or alias) |\n| `GET  \u002Fv1\u002Fmodels`              | -      | List available models + aliases                         |\n| `GET  \u002Fv1\u002Fmode-aliases`        | -      | List mode-override aliases                              |\n| `GET  \u002Fv1\u002Frelay\u002Fzk`            | -      | ZK primitives snapshot                                  |\n| `GET  \u002Fhealth`                  | -      | Health + uptime + stats                                 |\n| `GET  \u002Fstats`                   | -      | Full request statistics (per-tier, per-model, costs)   |\n| `GET  \u002Fconfig`                  | -      | Sanitized config + routing version                      |\n| `POST \u002Freload-config`           | -      | Hot-reload `zkrouter.config.json`                       |\n| `GET  \u002Fv1\u002Fadmin\u002Fstatus`        | admin  | Operator status: kill switch, tier override, audit queue |\n| `POST \u002Fv1\u002Fadmin\u002Fkill-switch`   | admin  | Toggle the kill switch (refuse all `\u002Fv1\u002Fchat`)         |\n| `GET  \u002Fv1\u002Fadmin\u002Faudit`         | admin  | Last 100 routing decisions (incl. blocked)              |\n| `POST \u002Fv1\u002Fadmin\u002Fforce-birth`   | admin  | Wipe receipt and re-provision a fresh OpenRouter key   |\n| `POST \u002Fv1\u002Fadmin\u002Fset-tier-override` | admin | Pin a tier for the next N requests                    |\n| `POST \u002Fv1\u002Fadmin\u002Freload-config` | admin  | Re-read `zkrouter.config.json` + reload env secret     |\n\n### Admin auth\n\nAll `\u002Fv1\u002Fadmin\u002F*` endpoints require `Authorization: Bearer \u003CCLAWDROUTER_ADMIN_SECRET>`.\nIf the env var is unset, all admin endpoints return **503 not_configured** (defense in depth).\n\n```bash\n# Status\ncurl -H \"Authorization: Bearer $CLAWDROUTER_ADMIN_SECRET\" \\\n  http:\u002F\u002Flocalhost:18800\u002Fv1\u002Fadmin\u002Fstatus\n\n# Activate kill switch with 60s TTL\ncurl -X POST -H \"Authorization: Bearer $CLAWDROUTER_ADMIN_SECRET\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"reason\":\"investigating abuse\",\"ttlSec\":60}' \\\n  http:\u002F\u002Flocalhost:18800\u002Fv1\u002Fadmin\u002Fkill-switch\n\n# Force the next 10 requests to use the REASONING tier\ncurl -X POST -H \"Authorization: Bearer $CLAWDROUTER_ADMIN_SECRET\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"tier\":\"REASONING\",\"requests\":10}' \\\n  http:\u002F\u002Flocalhost:18800\u002Fv1\u002Fadmin\u002Fset-tier-override\n\n# Audit the last 100 routing decisions\ncurl -H \"Authorization: Bearer $CLAWDROUTER_ADMIN_SECRET\" \\\n  http:\u002F\u002Flocalhost:18800\u002Fv1\u002Fadmin\u002Faudit\n\n# Rotate the admin secret without a restart\nexport CLAWDROUTER_ADMIN_SECRET=new-secret\ncurl -X POST -H \"Authorization: Bearer $CLAWDROUTER_ADMIN_SECRET\" \\\n  http:\u002F\u002Flocalhost:18800\u002Fv1\u002Fadmin\u002Freload-config\n```\n\n## Configuration\n\n`zkrouter.config.json` is looked up in this order:\n\n1. `$ZKROUTER_CONFIG` env var\n2. `.\u002Fzkrouter.config.json` (cwd)\n3. `~\u002F.config\u002Fzk-router\u002Fconfig.json`\n\nIf no file is found, built-in defaults apply. Edit to override the tier→model mapping:\n\n```json\n{\n  \"port\": 18800,\n  \"host\": \"127.0.0.1\",\n  \"logLevel\": \"info\",\n  \"openRouterBaseUrl\": \"https:\u002F\u002Fopenrouter.ai\u002Fapi\u002Fv1\",\n  \"tiers\": {\n    \"SIMPLE\":  { \"primary\": \"google\u002Fgemini-2.5-flash\",     \"fallback\": [\"deepseek\u002Fdeepseek-chat\"] },\n    \"MEDIUM\":  { \"primary\": \"deepseek\u002Fdeepseek-chat\",      \"fallback\": [\"anthropic\u002Fclaude-haiku-4.5\"] },\n    \"COMPLEX\": { \"primary\": \"anthropic\u002Fclaude-sonnet-4.5\", \"fallback\": [\"openai\u002Fgpt-4o-mini\"] },\n    \"REASONING\": { \"primary\": \"openai\u002Fo3\",                \"fallback\": [\"anthropic\u002Fclaude-opus-4.5\"] }\n  }\n}\n```\n\n## Environment Variables\n\n| Variable                          | Default | Description                                  |\n| --------------------------------- | ------- | -------------------------------------------- |\n| `OPENROUTER_API_KEY`              | -       | Skip the Birth bot; use this key directly.   |\n| `CLAWDROUTER_ADMIN_SECRET`        | -       | Bearer secret for `\u002Fv1\u002Fadmin\u002F*` (kill switch, force-birth, audit). Required for admin ops. |\n| `ZKROUTER_PORT`                   | `18800` | Server port                                  |\n| `ZKROUTER_HOST`                   | `127.0.0.1` | Bind address                              |\n| `ZKROUTER_LOG_LEVEL`              | `info`  | `debug` \u002F `info` \u002F `warn` \u002F `error` \u002F `silent` |\n| `ZKROUTER_BIRTH_ENABLED`          | `true`  | Master switch for the Birth bot             |\n| `ZKROUTER_BIRTH_CONTROL_PLANE_URL` | `https:\u002F\u002Fx402.wtf` | Control plane base URL             |\n| `ZKROUTER_BIRTH_VAULT_DIR`        | `~\u002F.zk-router\u002Fbirth` | Receipt directory                |\n| `ZKROUTER_BIRTH_AUTO_TRIGGER`     | `true`  | Run Birth on startup                       |\n| `ZKROUTER_BIRTH_TIMEOUT_MS`       | `8000`  | HTTP timeout for the control plane         |\n| `ZKROUTER_ZK_ENABLED`             | `true`  | Master switch for ZK                        |\n| `ZKROUTER_ZK_STORAGE_DIR`         | `~\u002F.zk-router\u002Fzk` | ZK journal directory                  |\n| `ZKROUTER_ZK_TREE_DEPTH`          | `20`    | Merkle tree depth (8 \u002F 16 \u002F 20 \u002F 26)        |\n\n## The 14-Dimension Classifier\n\n| Dimension            | Weight | Detection                                |\n| -------------------- | ------ | ---------------------------------------- |\n| Reasoning markers    | 0.25   | \"prove\", \"theorem\", \"step by step\"       |\n| Technical terms      | 0.18   | \"algorithm\", \"kubernetes\", \"distributed\" |\n| Code presence        | 0.12   | \"function\", \"async\", \"import\", \"```\"     |\n| Multi-step patterns  | 0.12   | \"first...then\", \"step 1\"                 |\n| Domain specificity   | 0.12   | \"quantum\", \"fpga\", \"zero-knowledge\"     |\n| Simple indicators    | 0.10   | \"what is\", \"define\", \"translate\"         |\n| Imperative verbs     | 0.06   | \"build\", \"create\", \"implement\"           |\n| Token count          | 0.04   | short (\u003C 50) vs long (> 500)             |\n| Agentic task         | 0.04   | \"read file\", \"edit\", \"run\", \"test\"       |\n| Creative markers     | 0.05   | \"story\", \"poem\", \"brainstorm\"            |\n| Question complexity  | 0.05   | Multiple question marks                  |\n| Constraint count     | 0.04   | \"at most\", \"maximum\", \"limit\"            |\n| Output format        | 0.03   | \"json\", \"yaml\", \"schema\"                 |\n| Reference complexity | 0.02   | \"above\", \"the docs\", \"the api\"           |\n| Negation complexity  | 0.01   | \"don't\", \"avoid\", \"without\"              |\n\nThe weighted score maps to a tier via configurable boundaries. Confidence is calibrated using a sigmoid function. **> 2 reasoning markers** forces the REASONING tier at high confidence.\n\n## Cost Impact\n\n| Tier             | % of Traffic | Output $\u002FM   | Savings         |\n| ---------------- | ------------ | ------------ | --------------- |\n| SIMPLE           | 40%          | $2.50        | **97% cheaper** |\n| MEDIUM           | 30%          | $1.10        | **99% cheaper** |\n| COMPLEX          | 20%          | $15.00       | best quality    |\n| REASONING        | 10%          | $40.00       | **47% cheaper** |\n| **Weighted avg** |              | **~$11.50\u002FM** | **~70% savings** |\n\n(Calculated against Claude Opus 4.5 baseline at $75\u002FM output tokens.)\n\n## What makes this different\n\n| Feature                    | OpenRouter | LiteLLM | zk-router     |\n| -------------------------- | ---------- | ------- | ------------- |\n| Open source                | ❌         | ✅      | ✅            |\n| Smart tier routing         | ❌         | ❌      | ✅            |\n| Mode overrides             | ❌         | ❌      | ✅            |\n| **Free OpenRouter at install** | ❌   | ❌      | ✅ (Birth)    |\n| **ZK-stamped routing decisions** | ❌ | ❌   | ✅            |\n| Zero-config startup         | ❌         | ❌      | ✅            |\n| Multilingual classifier    | ✅         | ❌      | ✅            |\n| External config hot-reload | ❌         | ✅      | ✅            |\n| Agentic auto-detection     | ❌         | ❌      | ✅            |\n| Context-length-aware routing | ❌        | partial | ✅            |\n\n## Credits\n\n- **Smart router** — adapted from [BlockRunAI\u002FClawRouter](https:\u002F\u002Fgithub.com\u002FBlockRunAI\u002FClawRouter) → [FreeRouter](https:\u002F\u002Fgithub.com\u002Fopenfreerouter\u002Ffreerouter) (MIT)\n- **ZK primitives** — ported from [clawdrouter](https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fclawd-router) (MIT)\n- **Birth bot** — ported from [clawdrouter](https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fclawd-router) (MIT)\n- **OpenRouter integration** — uses the [OpenRouter Chat Completions API](https:\u002F\u002Fopenrouter.ai\u002Fdocs)\n- **Sponsored key provisioning** — powered by [x402.wtf](https:\u002F\u002Fx402.wtf) control plane\n\n## License\n\nMIT\n",{"name":5,"homepage":24,"metadata":25,"description":7},"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fzk-router",{"emoji":26,"requires":27},"🔀",{"config":28},[],"main","be3de0244dc1a57e323d8160787ebb40fb64930e","skills\u002Fzkrouter","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002FSolizardking","https:\u002F\u002Fmusebook.trade","Got a mile high and never came down","2026-10-08 23:20:13",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add Solizardking\u002Fskillhub-main --skill zkrouter",{"tool":44,"command":45},"bunx","bunx skills add Solizardking\u002Fskillhub-main --skill zkrouter",{"tool":47,"command":48},"pnpm","pnpm dlx skills add Solizardking\u002Fskillhub-main --skill zkrouter","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzkrouter\u002FSKILL.md",true,[],[53,60,67,74,82,89],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M78E0R1Z8BDT6EDTHY17MTNB","zk","For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M78E0P3ZTZ1YWF8MD5MM23QE","zk-omni-messaging","Zero-knowledge omnichain messaging between Robinhood Chain and Solana using CheshireZkOmniMessenger (msgType 4) with nullifier anti-replay and the zk-omni-relayer service.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk-omni-messaging\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M78E0JXZ2PNB1896VXAGDBWD","zerion-wallet-data","Use when the user asks to check a wallet's portfolio, token balances, DeFi positions, PnL, transaction history, or NFTs. Provides interpreted on-chain data across 40+ EVM chains and Solana via x402 pay-per-request or API key — no raw RPC decoding needed.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzerion-wallet-data\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":78,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M78E0G14FH9GRRTQYMKD5E59","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M78E0C2ZYA99CFFDNB7ZMK5S","yield-optimization","Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit\u002Fwithdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter\u002Fexit a position, or check portfolio balances.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyield-optimization\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M78E0AEPZCZXVS218JQY8EG9","writing-great-skills","Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-great-skills\u002FSKILL.md",[],[]]