Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

new-api

БесплатноБез исполняемых скриптовНе проверен

New API is a self-hosted AI gateway that puts many LLM providers behind one OpenAI-compatible endpoint, with a web console for channels, API keys, quotas and…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

New API — a self-hosted gateway for your LLM providers

Overview

New API (QuantumNous, a project built on One API) is a Go service with an embedded web console. You add upstream providers as channels (OpenAI, Anthropic, Gemini, Azure OpenAI, Bedrock, Vertex AI, DeepSeek, Qwen and other compatible services), then issue API keys that clients use against a single base URL. The gateway handles model mapping, channel priority and weights, retries, per-key quotas, groups with price ratios, and usage logs.

It speaks OpenAI Chat Completions and Responses, Anthropic Messages (/v1/messages) and Gemini (/v1beta/...), plus embeddings, rerank, images and audio. What converts between protocols depends on the channel and upstream model.

It is a gateway you operate, not a library. If the user wants an in-process Python router, use the litellm skill instead. The agent's realistic jobs here are deploying the service, configuring it, and calling it. Initial setup (admin account, channels, keys) is done in the web console.

Use it only with upstream keys and accounts you are entitled to use, within each provider's terms. Offering it to the public as a resale service carries filing, licensing, tax and content-safety duties in many jurisdictions; the project README says to complete them first.

Instructions

Try it locally (SQLite)

Pin a release tag from the GitHub releases page instead of latest. v1.0.0-rc.48 was the current tag when this skill was written and started cleanly in a test run.

mkdir -p data
docker run --name new-api -d --restart unless-stopped \
  -p 127.0.0.1:3000:3000 \
  -e TZ=Europe/Berlin \
  -v "$(pwd)/data:/data" \
  calciumion/new-api:v1.0.0-rc.48
curl -s http://127.0.0.1:3000/api/setup

Right after the first start the setup endpoint answers {"data":{"status":false,"root_init":false,"database_type":"sqlite"},"success":true}. Open http://127.0.0.1:3000 and complete the wizard to create the administrator account. The SQLite file (one-api.db) lives in the mounted data directory, so keep that directory across container replacements. Without a valid key, GET /v1/models returns HTTP 401 with "Invalid token", which confirms the relay is up.

If port 3000 is taken, change only the host side, for example -p 127.0.0.1:3410:3000.

Production: Docker Compose with PostgreSQL and Redis

The repository's docker-compose.yml starts New API, PostgreSQL 15 and Redis. Its example passwords are placeholders that must be replaced.

git clone https://github.com/QuantumNous/new-api.git
cd new-api
git checkout v1.0.0-rc.48
openssl rand -hex 32          # use the output as SESSION_SECRET

Edit docker-compose.yml before the first start:

  • Replace the Postgres password (POSTGRES_PASSWORD) and the one inside SQL_DSN.
  • Replace the Redis --requirepass value and the one inside REDIS_CONN_STRING.
  • Uncomment SESSION_SECRET and set it to the generated value.
  • Change the image from calciumion/new-api:latest to the pinned tag.
  • Behind HTTPS also set SESSION_COOKIE_SECURE=true and SESSION_COOKIE_TRUSTED_URL to the exact public origin, such as https://llm.northwind.example (no path, no wildcard).
docker compose up -d
docker compose logs -f new-api

The compose file maps port 3000 to all interfaces. Put it behind a reverse proxy with TLS, and change the mapping to 127.0.0.1:3000:3000 if the proxy runs on the same host. The proxy must allow streaming and WebSocket upgrades.

Environment variables

Variable Purpose
SQL_DSN Main database. Unset means SQLite. PostgreSQL: postgresql://user:pw@host:5432/new-api; MySQL: user:pw@tcp(host:3306)/new-api
LOG_SQL_DSN Separate database for logs (ClickHouse also supported)
REDIS_CONN_STRING redis://:password@host:6379
SESSION_SECRET Persistent random secret; every node must share it
CRYPTO_SECRET Defaults to SESSION_SECRET
SESSION_COOKIE_SECURE, SESSION_COOKIE_TRUSTED_URL HTTPS console hardening
TRUSTED_PROXIES Reverse-proxy IPs/CIDRs, or none
PORT, TZ, STREAMING_TIMEOUT Listen port, time zone, streaming timeout in seconds (source default 300)

Setting variables only in .env.example does nothing for the container; put them under environment: or env_file: in Compose. Several nodes must share the same database, secrets and Redis, otherwise rate limits and sessions diverge.

Configure channels, groups and keys (web console)

  1. Add a channel per upstream: type, the upstream key from your provider's console, the model list, and a group. Run the channel test.
  2. For fallback, add a second channel serving the same model name and give it a lower priority than the first (higher numbers are tried first); channels with equal priority share load by weight. A channel can also hold several upstream keys. Fallback only happens through retries: the retry count setting defaults to 0, and each retry mov
Полный SKILL.md на GitHub

Установить new-api в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл new-api?

New API is a self-hosted AI gateway that puts many LLM providers behind one OpenAI-compatible endpoint, with a web console for channels, API keys, quotas and usage logs. Use when the user asks to "self-host an LLM gateway", "give each team its own API key and budget", "route requests across several upstream providers with failover", "deploy new-api", or "point an OpenAI client at my own gateway". Lawful use with your own upstream keys only.

Как установить скилл new-api?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл new-api запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить new-api с