К основному содержанию
скилл CX Codex

newapi — скилл для Claude Code: шлюз New API и ключи без утечек

Скилл для работы с шлюзом New API: модели, группы, баланс, токены и безопасная подстановка ключей в конфиги и команды.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add QuantumNous/skills --skill newapi -a claude-code
Открыть на GitHub

Что делает newapi

New API — открытый шлюз, который собирает нескольких провайдеров моделей за интерфейсами, совместимыми с OpenAI, Claude и Gemini. Скилл newapi даёт агенту доступ к управлению моделями, группами, балансом и токенами через набор скриптов.

Внутри — api.js, copy-key.js, inject-key.js и exec-token.js. Все обращения к New API идут через них, а не через curl или fetch. Ключ sk- не попадает в чат, файлы и логи: вместо этого агент предлагает copy-token, apply-token или exec-token. После create-token он не делает повторных запросов за ключом, поэтому не ждите, что значение покажется в ответе.

Для работы нужен доступ к вашему инстансу New API и настройка из docs/setup.md — она читается при первом вызове. Учтите: scan-config маскирует секреты лишь по мере возможностей и не гарантирует, что скроет всё в любом формате. Это повод не полагаться на него как на единственную защиту.

Какие задачи решает

  • посмотреть список доступных моделей
  • проверить баланс аккаунта
  • создать новый API-токен
  • подставить ключ в конфиг, не показывая его
  • выполнить команду с ключом без утечки в логи

Примеры запросов агенту

  • /newapi models
  • /newapi balance
  • /newapi apply-token <token_id> <file_path>

Как установить newapi

1Через Skills CLI (Vercel)

npx skills add QuantumNous/skills --skill newapi -a claude-code

2Вручную: положить файлы

~/.claude/skills/newapi/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/newapi/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о newapi

Как установить newapi в Claude?

Выполните npx skills add QuantumNous/skills --skill newapi -a claude-code. Скилл встанет в ~/.claude/skills/newapi/SKILL.md.

Что делает newapi?

Управляет моделями, группами, балансом и токенами в шлюзе New API, а также безопасно подставляет ключи в конфиги и команды.

Ключи показываются в чате?

Нет. Значение sk- не выводится в чат, файлы и логи — для работы с ним есть copy-token, apply-token и exec-token.

Исходный текст

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

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
api-auth-key-management Samuel Berthe Скилл помогает спроектировать систему API-ключей для внешних клиентов сервиса. Пригодится при настройке ротации без простоя и разграничении сервисных доступов. CX Codex +1 7 800установок api-gateway-backend-security-and-rate-limiting официальный google Настраивает аутентификацию клиентов и доступ API Gateway к бэкендам, а также квоты по проектам. Пригодится для защиты Cloud Run и разбора ошибок квот. CX Codex 360установок n8n-credentials-and-security-official n8n-io Скилл следит, чтобы ключи и токены в воркфлоу n8n шли через систему учётных данных, а не лежали текстом в нодах. CX Codex +1 2 000установок credentials google-deepmind Проверяет, есть ли нужный ключ в .env, и просит добавить его так, чтобы значение не попало в чат. CX Codex +1 1 400установок credential-scanner UseAI-pro Сканирует проект на открытые ключи и пароли до того, как скилл с доступом к файлам их прочитает. CX Codex +1 538установок ghost-scan-secrets ghostsecurity Ищет утёкшие API-ключи, токены и пароли в кодовой базе проекта. Пригодится перед коммитом или при аудите репозитория на скрытые секреты. CX Codex +1 4 400установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой