LLMAPI
OpenAI-compatible API Gateway with Anthropic support and token package sales.
Features
- OpenAI Compatible: Fully compatible with OpenAI API format
- Anthropic Support: Native support for Anthropic API
- Multi-Channel Management: Support for multiple AI providers (DeepSeek, Moonshot, MiniMax, Claude, Gemini, etc.)
- Token Package Sales: Built-in shop system for selling token packages
- User Management: Complete user and quota management system
- Usage Logging: Detailed API usage logs and statistics
- OAuth Support: GitHub, Lark, OIDC authentication
Installation
pip install x-llmapi
Quick Start
# Start the server
llmapi run
# Or with uvicorn directly
uvicorn llmapi.main:app --host 0.0.0.0 --port 3000
# Run with custom port
llmapi run -p 8080
Configuration
Configure via environment variables:
export SESSION_SECRET="your-secret-key"
export SQL_DSN="sqlite:///one-api.db"
export QUOTA_FOR_NEW_USER=1000000
See llmapi/config.py for all available options.
Development
# Clone the repository
git clone https://github.com/kandada/llmapi.git
cd llmapi
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
Acknowledgments
This project is inspired by one-api and LiteLLM. Thank you for their excellent work in the open source community.
Author
xiefujin
- Email: 490021684@qq.com
- GitHub: github.com/kandada/llmapi
License
GNU General Public License v3.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
x_llmapi-0.0.2.tar.gz
(769.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
x_llmapi-0.0.2-py3-none-any.whl
(755.7 kB
view details)
File details
Details for the file x_llmapi-0.0.2.tar.gz.
File metadata
- Download URL: x_llmapi-0.0.2.tar.gz
- Upload date:
- Size: 769.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
635b5897894eeaeb422b635f8b6e66fff3314d31b1b007fff9dff1e1dd441983
|
|
| MD5 |
a894877333105ff27c8102bcf8413f6d
|
|
| BLAKE2b-256 |
a3af46721899f85668609bee9bddc46151ae6c914d2c1498502803e601469084
|
File details
Details for the file x_llmapi-0.0.2-py3-none-any.whl.
File metadata
- Download URL: x_llmapi-0.0.2-py3-none-any.whl
- Upload date:
- Size: 755.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f6dac9118cf7317442c76a43cdaaefaa7072fcd480afe049381c9e1e5dc65f4
|
|
| MD5 |
6334678554f87d5d9ac4cb999d6859a6
|
|
| BLAKE2b-256 |
9bddb57a1aba4135fa6f8b0c84ba5951573331a52972f09f011aea9e60bab67b
|