Skip to main content

OpenAI-compatible API Gateway with Anthropic support and token package sales

Project description

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

Project details


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.1.tar.gz (755.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

x_llmapi-0.0.1-py3-none-any.whl (750.8 kB view details)

Uploaded Python 3

File details

Details for the file x_llmapi-0.0.1.tar.gz.

File metadata

  • Download URL: x_llmapi-0.0.1.tar.gz
  • Upload date:
  • Size: 755.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for x_llmapi-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e948f9f924cd4eef30d76ab39c1b33b8d9180ed76939b95e0573aa4a35ca0f7d
MD5 8a61165efba45d8bc7e987a4088f0082
BLAKE2b-256 a46e51e66638a6ddbec523793638921ce7c515427f56a40f641b03d4dda60d74

See more details on using hashes here.

File details

Details for the file x_llmapi-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: x_llmapi-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 750.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for x_llmapi-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8cb00ce049896d1bf9a0444f8b9e41357bbedefc92b8cf0d9dc28537402eea5b
MD5 9735827014586aa0fc4561c983ee7da9
BLAKE2b-256 dfa0f04f5fb46bebb3a8f6a0a0e041b8fb1f6e3c9071f8037558cf8d9f88f11f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page