Skip to main content

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

License

GNU General Public License v3.0

Metadata

Release files for x-llmapi 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for x-llmapi 0.0.2
File Size Uploaded
x_llmapi-0.0.2.tar.gz 769.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for x-llmapi 0.0.2
File Interpreter ABI Platform
x_llmapi-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.5 MB

Release files / x_llmapi-0.0.2.tar.gz

Download URL x_llmapi-0.0.2.tar.gz
Size 769.7 kB
Tags Source
SHA-256 checksum
How to use checksums
635b5897894eeaeb422b635f8b6e66fff3314d31b1b007fff9dff1e1dd441983
BLAKE2b-256 checksum
How to use checksums
a3af46721899f85668609bee9bddc46151ae6c914d2c1498502803e601469084
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release files / x_llmapi-0.0.2-py3-none-any.whl

Download URL x_llmapi-0.0.2-py3-none-any.whl
Size 755.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f6dac9118cf7317442c76a43cdaaefaa7072fcd480afe049381c9e1e5dc65f4
BLAKE2b-256 checksum
How to use checksums
9bddb57a1aba4135fa6f8b0c84ba5951573331a52972f09f011aea9e60bab67b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page