openrouter-setup

openrouter-setup is a command for Claude Code from OXI-717/ai-native-toolkit. It costs 20 tokens per session (769 once invoked), scanned A, original, MIT.

A setup command for connecting software to OpenRouter, a service that provides access to several AI models through an OpenAI-compatible interface. It uses an environment variable named OPENROUTER_API_KEY so the secret stays out of source code.

In plain words
What is it for?
Use it to configure or smoke-test access to models such as Kimi K3, DeepSeek V4, or GLM through OpenRouter, while keeping the API key in the shell environment.
Why use it?
It provides a short procedure for configuring the connection and checking whether the required key is available, without placing the key in a repository. It also explains what to do when the key is missing.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the openrouter-setup plugin — 1 skill, 1 command shipped together

Good fit Use it to configure or smoke-test access to models such as Kimi K3, DeepSeek V4, or GLM through OpenRouter, while keeping the API key in the shell environment.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/oxi-717/ai-native-toolkit/openrouter-setup
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/OXI-717/ai-native-toolkit

Made for: Claude Code.

Or install openrouter-setup, the plugin that ships this one along with the rest of its 1 skill, 1 command.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for openrouter-setup

README.md
[![agentmods](https://agentmods.dev/badge/commands/oxi-717/ai-native-toolkit/openrouter-setup/github.svg)](https://agentmods.dev/commands/oxi-717/ai-native-toolkit/openrouter-setup)
Your own site
<a href="https://agentmods.dev/commands/oxi-717/ai-native-toolkit/openrouter-setup"><img src="https://agentmods.dev/badge/commands/oxi-717/ai-native-toolkit/openrouter-setup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for openrouter-setup

Your own site · 80×15
<a href="https://agentmods.dev/commands/oxi-717/ai-native-toolkit/openrouter-setup"><img src="https://agentmods.dev/badge/commands/oxi-717/ai-native-toolkit/openrouter-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 769 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.00769
Opus 5.5 $0.00008 $0.00308
Sonnet 5.5 $0.00004 $0.00154
Haiku 4.5 $0.00002 $0.00077

Measured 14d ago against content hash 9a71e4d5ba08, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

openrouter-setup scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 14d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sS https://openrouter.ai/api/v1/chat/completions \
plugins/openrouter-setup/commands/openrouter-setup.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenRouter Access Setup

Configure OpenRouter as an OpenAI-compatible endpoint for waitlist-gated models (moonshotai/kimi-k3, deepseek/deepseek-v4, z-ai/glm-*). One key, OPENROUTER_API_KEY, unlocks all of them.

  • Endpoint: https://openrouter.ai/api/v1 (OpenAI Chat Completions compatible)
  • Key lives in env only — never in code or any repo file.

Input

$ARGUMENTS

Optional model slug to smoke-test; defaults to moonshotai/kimi-k3.

Workflow

This is an abbreviated quick-reference. The authoritative, full workflow lives in skills/openrouter-setup/SKILL.md — follow it (it covers the security contract, client-wiring examples, and the full error table).

Step 1: Check the key is in the environment (never print the value)

if [ -n "$OPENROUTER_API_KEY" ]; then
  echo "OPENROUTER_API_KEY is set (length ${#OPENROUTER_API_KEY})"
else
  echo "OPENROUTER_API_KEY is NOT set"
fi

Step 2: If missing — user creates the key interactively

Direct the user to https://openrouter.ai → Keys → Create Key (sk-or-v1-…). The agent cannot do this step.

Step 3: Persist in shell profile (env, not code)

Tell the user to add to ~/.zshrc / ~/.bashrc (NOT a repo file):

export OPENROUTER_API_KEY='sk-or-v1-…'

source ~/.zshrc or start a new shell. Do not edit the user's profile without confirmation; never write the key under the project tree.

Step 4: Smoke-test (argument slug or default moonshotai/kimi-k3)

: "${OPENROUTER_API_KEY:?OPENROUTER_API_KEY is not set — see Step 3}"
curl -sS https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<MODEL_SLUG>",
    "max_tokens": 16,
    "messages": [{"role": "user", "content": "ping"}]
  }'

200 + choices = OK. 401 = bad key; 402 = no credits; 404 = wrong/retired slug (check openrouter.ai/models).

Step 5: Wire into clients

Point any OpenAI-compatible client at base_url=https://openrouter.ai/api/v1 with api_key read from $OPENROUTER_API_KEY. See SKILL.md for the Python openai SDK example and runtime-provider notes.

Read the full file on GitHub · 82 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 14d ago Changed · -25 tokens per session 9a71e4d5ba08
  2. 1mo ago First seen · 82 lines · 45 tokens per session scan A 06c58cdb1455

Subscribe to this mod's changes

openrouter-setup is a command published in the GitHub repository OXI-717/ai-native-toolkit (9 stars, last pushed 14d ago), licensed MIT. It adds 20 tokens to every session and 769 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.