nox-api

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2026 License: AGPL-3.0 Imports: 28 Imported by: 0

README

Nox API

Nox API

Unified AI gateway. One endpoint, every model.

Route requests to 40+ AI providers through a single OpenAI-compatible API. Built-in billing, rate limiting, auth, and a modern admin dashboard.

简体中文 · 繁體中文 · English · Français · 日本語

license release docker GoReportCard


Why Nox API

  • One API, every provider — OpenAI, Claude, Gemini, AWS Bedrock, Azure, DeepSeek, Mistral, Cohere, Ollama, and 30+ more behind a single /v1/chat/completions endpoint.
  • Drop-in compatible — Anything that speaks OpenAI can talk to Nox API. No SDK changes needed.
  • Smart routing — Weighted load balancing, automatic failover, per-user model rate limiting.
  • Pay-as-you-go billing — Token-level metering with cache-aware billing for all major providers.
  • Multi-format relay — Native support for OpenAI Chat/Responses, Claude Messages, Gemini, and automatic format conversion between them.
  • Enterprise-ready auth — JWT, OAuth (GitHub, Discord, OIDC), Telegram, WebAuthn/Passkeys, 2FA.
  • Modern dashboard — React + Radix UI + Tailwind. Data visualization, channel management, user admin.

Quick Start

docker run -d --name nox-api --restart always \
  -p 3000:3000 -v ./data:/data \
  drleomeng/nox-api:latest

Open http://localhost:3000 — default admin credentials: root / 123456

Docker Compose
git clone https://github.com/LeoMengTCM/nox-api.git
cd nox-api
# edit docker-compose.yml to your liking
docker compose up -d

Supported Providers

Provider Type Provider Type
OpenAI Chat, Responses, Realtime, Images, Audio, Embeddings Anthropic Claude Chat (Messages), native format
Google Gemini Chat, native format AWS Bedrock Claude, etc.
Azure OpenAI Full OpenAI compat Google Vertex AI Gemini, Claude
DeepSeek Chat Mistral Chat
Cohere Chat, Rerank xAI (Grok) Chat
Ollama Local models Cloudflare Workers AI Chat
Baidu (Wenxin) Chat Alibaba (Qwen) Chat, Images
Zhipu (GLM) Chat Tencent Hunyuan Chat
iFlytek (Spark) Chat Moonshot (Kimi) Chat
MiniMax Chat, TTS Volcengine (Doubao) Chat, TTS
SiliconFlow Chat Perplexity Chat
Jina Rerank, Embeddings Dify ChatFlow
OpenRouter Multi-model Replicate Inference
Coze Bot API Midjourney Proxy Image generation
Suno API Music Jimeng Image generation

Key Features

Routing & Reliability
  • Channel weighted random & priority routing
  • Automatic retry on failure with configurable retry count
  • Channel affinity — sticky routing per user/token
  • Per-user and per-model rate limiting
Billing & Quotas
  • Token-level pay-per-use billing
  • Cache-aware billing (prompt cache, context caching)
  • Online top-up (Stripe, EPay)
  • Subscription plans with quota management
  • Redemption codes
Format Conversion
  • OpenAI Chat ↔ Claude Messages — bidirectional
  • OpenAI Chat → Gemini — automatic
  • Gemini → OpenAI Chat — text support
  • OpenAI Chat ↔ Responses — in progress
  • Reasoning effort suffixes (-high, -medium, -low) for o3, GPT-5, Gemini, Claude thinking models
Channel Management
  • Per-channel system prompt injection (prepend or override mode)
  • Model selector with provider-based categorization (OpenAI, Anthropic, Google, etc.)
  • Upstream model fetching with search, filter, and individual selection
  • 57 channel types supported
Auth & Security
  • JWT tokens with scoped permissions
  • OAuth: GitHub, Discord, LinuxDO, Telegram, OIDC
  • WebAuthn / Passkeys
  • Two-factor authentication (TOTP)
  • User avatar system with upload and display
  • IP-based and model-based rate limiting
Admin Dashboard
  • Real-time usage statistics and charts
  • Channel health monitoring
  • User and token management
  • Model pricing configuration
  • Multi-language UI (zh, en, fr, ja, vi, ru)

Deployment

Requirements
Component Requirement
Database SQLite (default), MySQL >= 5.7.8, or PostgreSQL >= 9.6
Runtime Docker recommended, or build from source (Go 1.22+)
Cache Redis (recommended for production), or in-memory
Environment Variables
Variable Description Default
SQL_DSN Database connection string (empty = SQLite)
REDIS_CONN_STRING Redis connection string
SESSION_SECRET Session secret (required for multi-node)
CRYPTO_SECRET Encryption key (required with Redis)
STREAMING_TIMEOUT Stream timeout in seconds 300

Full list: Environment Variables


Documentation

Installation docs.noxapi.dev/en/docs/installation
API Reference docs.noxapi.dev/en/docs/api
Environment Variables docs.noxapi.dev/en/docs/installation/config-maintenance/environment-variables
FAQ docs.noxapi.dev/en/docs/support/faq

Acknowledgements

Nox API is built upon the foundation of New API by Calcium-Ion. We are grateful for their pioneering work on the AI API gateway ecosystem.


Contributing

Bug reports, feature requests, and pull requests are welcome at GitHub Issues.


License

GNU Affero General Public License v3.0 (AGPLv3)

For commercial licensing inquiries: leomengtcm@gmail.com


If Nox API is useful to you, consider giving it a star.

Star History Chart

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL