--- name: openrouter-key-management description: Administer OpenRouter from natural-language requests through current official APIs, including API keys and quotas, credits, organization members, workspaces and memberships, budgets, guardrails, BYOK provider credentials, observability destinations, and presets. Use for OpenRouter dashboard-style account, organization, access, privacy, routing, monitoring, or administrative operations, and to determine when an operation still requires the official website. --- # OpenRouter Administration Use official MCP tools first when they expose the operation. For administration outside MCP, search current official documentation and OpenAPI, then use `scripts/openrouter_access.py`. Never reproduce its authentication, redaction, or request logic inline. ## Route prompt-driven administration - API keys: inspect the current key; list, create, update, disable, or delete managed keys; configure limits, resets, expiry at creation, workspace, and owner. - Account visibility: read credits, key usage, limits, organization members, workspaces, memberships, and budgets. - Workspace controls: create, inspect, update, or delete workspaces; add or remove members; manage daily, weekly, monthly, or lifetime budgets. - Guardrails: create, inspect, update, delete, and assign guardrails to keys or members; manage budgets, model/provider policies, ZDR, and content filters. - BYOK: list and manage provider credentials, priority, fallback, filters, names, and enabled state. - Observability: manage Broadcast destinations, sampling, privacy mode, filters, enabled state, and workspace scope. - Presets: manage presets and versions through the current official API. Use an inference key when the endpoint requires one; do not invoke a preset's billable inference route through this administration skill. For API-backed operations without a dedicated command, use `api-request`. It accepts only allowlisted administration path families, blocks billable inference paths, requires `--confirm-write` for non-GET requests, and redacts secrets and identifiers from output. Confirm the exact method, path, authentication type, and request body against current official documentation immediately before use. ## Respect the public API boundary Do not treat private dashboard network calls as supported APIs. Account sign-in and security, the first Management API Key, purchases and payment methods, auto top-up, invoices and tax details, subscriptions, enterprise contracting, SSO setup, and support actions may require the official website when no current public endpoint exists. Open only the exact required page and complete everything else through MCP or the official API. Never request a provider key, observability secret, payment credential, password, or token in chat. For a secret-bearing API request, have the user prepare a local JSON body file with mode `0600`, pass its path to `api-request`, and remove it after the user confirms success. If a safe local handoff is not practical, use the official secret-entry page. ## Discover access without assumptions 1. Use `current` with `OPENROUTER_API_KEY` for an assigned inference key. Report limits, remaining allowance, reset period, usage, expiry, and scope without displaying the environment value. 2. Use `OPENROUTER_MANAGEMENT_API_KEY` only for endpoints documented as management operations. A regular member may not have organization-administrator permissions. 3. Keep identifiers shortened unless an exact identifier is required for an approved operation. Explain `403` responses as permission boundaries rather than authentication failures. ## Require confirmation for writes Before every non-GET request, show the target resource, exact changes, financial or privacy effect, reversibility, and authentication scope. Execute only after explicit confirmation. Require especially clear confirmation before deleting resources, removing limits, changing budgets or privacy controls, assigning guardrails, storing provider or observability credentials, or changing workspace membership. `create-key` never prints the one-time plaintext key. It writes the secret to a mode-`0600` file or copies it to the macOS clipboard with `--clipboard`. Tell the user to store it immediately and delete any temporary file only after safe receipt is confirmed. ## Commands ```bash python3 scripts/openrouter_access.py current python3 scripts/openrouter_access.py list-keys python3 scripts/openrouter_access.py credits python3 scripts/openrouter_access.py list-members python3 scripts/openrouter_access.py list-workspaces python3 scripts/openrouter_access.py list-budgets --workspace WORKSPACE python3 scripts/openrouter_access.py create-key --name NAME --limit 25 --limit-reset monthly --clipboard python3 scripts/openrouter_access.py update-key --hash HASH --limit 50 --limit-reset monthly python3 scripts/openrouter_access.py delete-key --hash HASH --confirm-hash HASH python3 scripts/openrouter_access.py set-budget --workspace WORKSPACE --interval monthly --limit-usd 100 python3 scripts/openrouter_access.py delete-budget --workspace WORKSPACE --interval monthly --confirm python3 scripts/openrouter_access.py api-request --method GET --path /guardrails python3 scripts/openrouter_access.py api-request --method POST --path /workspaces --body-file request.json --confirm-write python3 scripts/openrouter_access.py api-request --auth inference --method GET --path /presets ``` Use the explicit key and budget commands when available. Use `api-request` only after checking the current official endpoint. Run `python3 scripts/openrouter_access.py --self-check` after changing the script.