Metadata-Version: 2.4
Name: x-llmapi
Version: 0.0.2
Summary: OpenAI-compatible API Gateway with Anthropic support and token package sales
Author-email: xiefujin <490021684@qq.com>
License-Expression: GPL-3.0
Project-URL: Homepage, https://github.com/kandada/llmapi
Project-URL: Documentation, https://github.com/kandada/llmapi#readme
Project-URL: Repository, https://github.com/kandada/llmapi
Project-URL: Issues, https://github.com/kandada/llmapi/issues
Keywords: api-gateway,openai,anthropic,proxy,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn[standard]>=0.23.0
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: aiosqlite>=0.19.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: passlib[bcrypt]>=1.7.4
Requires-Dist: bcrypt>=4.0.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: sse-starlette>=1.6.0
Requires-Dist: email-validator>=2.0.0
Requires-Dist: anthropic>=0.18.0
Requires-Dist: stripe>=7.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: httpx>=0.24.0; extra == "dev"

# 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

```bash
pip install x-llmapi
```

## Quick Start

```bash
# 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:

```bash
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

```bash
# 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](https://github.com/songquanpeng/one-api) and [LiteLLM](https://github.com/BerriAI/litellm). Thank you for their excellent work in the open source community.

## Author

**xiefujin**
- Email: 490021684@qq.com
- GitHub: [github.com/kandada/llmapi](https://github.com/kandada/llmapi)

## License

GNU General Public License v3.0
