Skip to content

A secure and efficient API key management system that helps developers and teams easily manage API keys for various AI model【一个安全且高效的API密钥管理系统,帮助开发者和团队轻松管理各种AI模型的API密钥】

License

Notifications You must be signed in to change notification settings

randomAndre/api-key-manager

Repository files navigation

API Key Manager

NanMeng API Key Manager Logo

English | 简体中文

A secure and efficient API key management system that helps developers and teams easily manage API keys for various AI models.

Preface

The API Key Manager aims to provide AI developers and enterprises with a one-stop solution for API key management. In today's diverse AI service environment, managing API keys from multiple providers is both cumbersome and poses security risks. This system helps users efficiently organize and utilize various service keys through secure encrypted storage, status monitoring, and convenient management features, reducing the risk of leakage and improving development efficiency. The system employs local storage technology, ensuring your sensitive key information is not uploaded to the cloud, further enhancing data security and privacy protection. Whether you are an individual developer or an enterprise user, the API Key Manager can meet your API key management needs. Of course, not only can it manage AI-related keys, but other related keys can also be uniformly managed using this manager.

For example, when using the dify project, you need to fill in multiple API keys for large AI models, which can be a headache. This is also one of the starting points of this project.

✨ Features

  • 🔑 API Key Management: Securely store and manage API keys from multiple AI service providers
  • 🔒 Security Encryption: Protect your API keys with advanced encryption technology
  • Status Monitoring: Monitor API key connection status in real time
  • 🌐 Multi-language Support: Switch between Chinese and English interfaces
  • ⚙️ Custom Settings: Customize system settings and preferences according to your needs
  • 🔄 Connection Testing: Test API connections directly from the dashboard
  • 📊 Usage Monitoring: Monitor API key usage and token consumption (Coming soon)

📋 Table of Contents

📸 Demo

Visit our demo site to experience the application.

API Key Management Page: Key Overview

API Key Overview

Adding Keys: Basic Key + Composite Key

New Key Complex New Key

Dashboard: Monitor Connection Status

Dashboard

System Settings: Password Changes and Other Operations

System Settings

Default login credentials:

  • Username: admin
  • Password: password

After logging in, it is recommended to change the password and remember it for long-term use.

📥 Installation

Vercel Deployment

Deploying the NanMeng API Key Manager with Vercel is the simplest method:

  1. Fork this repository to your GitHub account
  2. Sign up or log in to Vercel
  3. Click "New Project" and import your forked repository
  4. Configure the following environment variables:
    • ENCRYPTION_KEY: A secure random string for encrypting API keys
    • ALLOW_REGISTRATION: Set to "true" or "false" to enable/disable user registration (registration feature has been deprecated)
  5. Click "Deploy"

Deploy with Vercel

Local Installation

Prerequisites

  • Node.js 18.x or higher
  • npm or yarn
  • Git

Steps

  1. Clone the repository:
git clone https://github.com/randomAndre/api-key-manager.git
cd api-key-manager
  1. Install Dependencies
npm install
# or
yarn install
  1. Environment Setup

Create a .env.local file in the root directory with the following variables:

ENCRYPTION_KEY=your-secure-random-string
  1. Development Mode

To run the application in development mode:

npm run dev
# or
yarn dev

The application will be available at http://localhost:3000.

  1. Production Build

To create a production build:

npm run build
npm start
# or
yarn build
yarn start
  1. Docker Deployment

You can also deploy using Docker:

# Build the Docker image
docker build -t nanmeng-api-key-manager .

# Run the container
docker run -p 3000:3000 -e ENCRYPTION_KEY=your-secure-key -e ALLOW_REGISTRATION=false nanmeng-api-key-manager

🚀 Usage

First-time Setup

  1. Access the application using the default credentials:

    • 用户名: admin
    • 密码: password
  2. After logging in, go to the Settings page and change the default password.

Managing API Keys

  1. Navigate to the "API Keys" section from the dashboard.

  2. Click "Add Key" to add a new API key.

  3. Fill in the required information:

    • Name: Descriptive name for the key
    • Provider: Service provider (e.g., OpenAI, Anthropic)
    • Key Type: Simple API key or Composite key
    • API Key: Your actual API key Additional fields for Composite key (AppID, Secret Key)
    • Base URL: API endpoint URL (default values for known providers)
    • Billing URL: Link to the provider's billing page (recommended)
  4. To test a key's connection, use the "Test" button on the dashboard.

    Note: Not only AI keys, but all related keys can be configured and stored.

⚠️ Security Recommendations

  1. Change the default admin password immediately after first login.
  2. Use a strong, unique ENCRYPTION_KEY for production deployments.
  3. If self-hosting, ensure your server has HTTPS enabled.
  4. Regularly backup your data.
  5. Regularly rotate your API keys to minimize risk.
  6. Store sensitive information such as API keys and encryption keys in environment variables.

🛠️ Configuration

Environment Variables

Variable Description Default
ENCRYPTION_KEY Key used for encrypting API keys Required

Language Settings

The application supports English and Chinese. Users can switch languages using the language selector in the interface.

Contributing

We welcome contributions from the community! To contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes and commit them (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.

About

A secure and efficient API key management system that helps developers and teams easily manage API keys for various AI model【一个安全且高效的API密钥管理系统,帮助开发者和团队轻松管理各种AI模型的API密钥】

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published