newapi — Claude Code skill: New API gateway and leak-free keys
A skill for the New API gateway: models, groups, balance, tokens, and secure key substitution into configs and commands.
npx skills add QuantumNous/skills --skill newapi -a claude-codeWhat newapi does
New API is an open-source gateway that puts several model providers behind Anthropic, Claude and Gemini compatible interfaces. The newapi skill lets the agent manage models, groups, balance and tokens through a set of scripts.
Inside are api.js, copy-key.js, inject-key.js and exec-token.js. Every New API call goes through them instead of curl or fetch. An sk- key never lands in chat, files or logs: the agent points you to copy-token, apply-token or exec-token instead. After create-token it makes no follow-up call for the key, so do not expect the value to appear in the reply.
You need access to your New API instance and the setup from docs/setup.md, which is read on first invocation. One caveat: scan-config redacts secrets on a best-effort basis and does not guarantee hiding everything in every format. Treat it as a convenience, not your only line of defence.
What it helps with
- list the models available to you
- check the account balance
- create a new API token
- write a key into a config without printing it
- run a command with the key kept out of logs
Example prompts for the agent
- /newapi models
- /newapi tokens
- /newapi exec-token <token_id> <command...>
How to install newapi
1Skills CLI (Vercel)
npx skills add QuantumNous/skills --skill newapi -a claude-code2Manually: put the files in place
~/.claude/skills/newapi/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/newapi/
1Skills CLI (Vercel)
npx skills add QuantumNous/skills --skill newapi -a codex2Manually: put the files in place
.agents/skills/newapi/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add QuantumNous/skills --skill newapi -a cursor2Manually: put the files in place
.cursor/skills/newapi/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install QuantumNous/skills newapi2Manually: put the files in place
.github/skills/newapi/SKILL.md1Skills CLI (Vercel)
npx skills add QuantumNous/skills --skill newapi -a gemini-cli2Platform CLI
gemini skills install https://github.com/QuantumNous/skills --path skills/newapiManually: put the files in place
.devin/skills/newapi/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add QuantumNous/skills --skill newapi -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about newapi
How do I install newapi in Claude?
Run npx skills add QuantumNous/skills --skill newapi -a claude-code. The skill lands in ~/.claude/skills/newapi/SKILL.md.
What does newapi do?
It manages models, groups, balance and tokens on the New API gateway, and substitutes keys into configs and commands securely.
Are keys ever shown in chat?
No. The sk- value stays out of chat, files and logs — use copy-token, apply-token or exec-token to work with it.
Source text
SKILL.md · MIT
---
name: newapi
description: Assistant for newapi (new-api), an open-source unified AI gateway platform (https://github.com/QuantumNous/new-api). Use when the user asks about New API, managing models, groups, balance, or tokens, or securely copying keys, applying them to config files, or using them in commands without exposing secrets.
---
# SKILL: newapi
newapi ([new-api](https://github.com/QuantumNous/new-api)) is an open-source unified AI gateway platform.
It aggregates multiple model providers behind OpenAI / Claude / Gemini compatible interfaces, and provides model, token, group, and balance management.
## Security Guidelines
This skill follows these security guidelines to protect API keys:
1. Do not expose any `sk-` key value in chat, files, code, logs, or command arguments. To use keys securely, tell the user to run `copy-token` (clipboard), `apply-token` (config file), or `exec-token` (CLI command).
2. All New API calls should go through the provided scripts (`api.js`, `copy-key.js`, `inject-key.js`, `exec-token.js`) rather than using `curl`, `wget`, `fetch`, or other HTTP clients to call New API endpoints directly.
3. Do not read `.env` files, environment variables containing credentials, or clipboard contents after `copy-key.js`.
4. When working with config files that may contain API keys, use `inject-key.js --scan` to get a sanitized view rather than reading them directly. Note: `scan-config` is best-effort and not guaranteed to redact every secret in every format.
5. After `create-token`, do not make any follow-up call to retrieve or list the key. Report success and tell the user they can use `copy-token <id>`, `apply-token <id> <file>`, or `exec-token <id> <command>` to securely use the key.
6. Do not modify the security scripts to disable masking or redirect output.
## How to Execute
1. **First invocation only** — read `${CLAUDE_SKILL_DIR}/docs/setup.md` for configuration, auth headers, and runtime detection.
2. Match the action from the table below.
3. Read the corresponding doc file for detailed steps.
4. If no arguments or unrecognized action, show the help table below.
5. If the user asks about newapi (what it is, how to use a command, or any API usage question like calling a specific model format) — read `${CLAUDE_SKILL_DIR}/docs/help.md` and follow the instructions there.
## Actions
| Action | Description | Details |
| -------- | ------------- | --------- |
| `models` | List available models | `docs/actions-query.md` |
| `groups` | List user groups | `docs/actions-query.md` |
| `balance` | Show account balance | `docs/actions-query.md` |
| `tokens` | List API tokens | `docs/actions-token.md` |
| `create-token` | Create a new API token | `docs/actions-token.md` |
| `switch-group` | Change a token's group | `docs/actions-token.md` |
| `copy-token` | Copy real key to clipboard (never shown) | `docs/actions-token.md` |
| `apply-token` | Apply token key to a config file securely | `docs/actions-config.md` |
| `exec-token` | Execute a command with the token key securely substituted | `docs/actions-exec.md` |
| `scan-config` | Inspect config structure with best-effort secret redaction | `docs/actions-config.md` |
| `help` | Answer questions about newapi | `docs/help.md` |
### `help` (or no arguments) — Show available actions
| Action | Usage | Description |
| -------- | ------- | ------------- |
| `models` | `/newapi models` | List available models |
| `groups` | `/newapi groups` | List user groups |
| `balance` | `/newapi balance` | Show account balance |
| `tokens` | `/newapi tokens` | List API tokens |
| `create-token` | `/newapi create-token <name> [--group=xxx]` | Create a new API token |
| `switch-group` | `/newapi switch-group <token_id> <group>` | Change a token's group |
| `copy-token` | `/newapi copy-token <token_id>` | Copy real key to clipboard (never shown) |
| `apply-token` | `/newapi apply-token <token_id> <file_path>` | Apply token key to a config file securely |
| `exec-token` | `/newapi exec-token <token_id> <command...>` | Execute a command with the token key securely substituted |
| `scan-config` | `/newapi scan-config <file_path>` | Inspect config structure with best-effort secret redaction |
| `help` | `/newapi help <question>` | Answer questions about newapi |
© QuantumNous · MIT · QuantumNous/skills