bella-openapi
Bella OpenAPI是一个提供了丰富的AI调用能力的API网关,可类比openrouter,与之不同的是除了提供聊天补全(chat-completion)能力外,还提供了文本向量化(text-embedding)、
What is bella-openapi?
Bella OpenAPI是一个提供了丰富的AI调用能力的API网关,可类比openrouter,与之不同的是除了提供聊天补全(chat-completion)能力外,还提供了文本向量化(text-embedding)、语音识别(ASR)、语音合成(TTS)、文生图、图生图等多种AI能力,同时集成了计费、限流和资源管理功能。且集成的所有能力都经过了大规模生产环境的验证。
Overview of bella-openapi
What it is
Bella OpenAPI is an API gateway that provides a variety of AI capabilities, comparable to OpenRouter. In addition to chat completion, it offers text embedding, speech recognition (ASR), speech synthesis (TTS), text-to-image, and image-to-image generation. It integrates billing, rate limiting, and resource management. All integrated capabilities have been verified in large-scale production environments.
Key features
- AI capabilities: chat completion (supports OpenAI ChatCompletion and Anthropic Message APIs), text embedding, real-time and file-based speech recognition, speech synthesis (streaming), real-time voice dialogue, text-to-image, and image-to-image (coming soon).
- Metadata management: four-layer structure (Category-Endpoint-Model-Channel) with flexible routing and a visual management interface.
- Unified login service: supports OAuth 2.0, CAS single sign-on, and API Key authentication; Redis-based distributed session storage.
- Billing and rate limiting: hierarchical API Key management, monthly quota control, and Redis-based distributed rate limiting.
- High-performance caching: multi-level cache architecture combining Redisson, Caffeine, and JetCache.
- High-performance log consumption framework: based on Disruptor for asynchronous processing, supporting billing, metrics collection, and rate limiting.
Use cases
- Serving all business lines of Beike Zhaofang (贝壳找房) with a daily average of 150 million API calls.
- Suitable for scenarios requiring chat completion, text embedding, speech recognition (real-time, offline, one-sentence), speech synthesis (streaming), and image generation.
- Can be used for unit testing and stress testing with built-in mock capabilities.
Getting started
Prerequisites: Docker and Docker Compose installed. Run from the project root directory.
./start.sh
./start.sh --github-oauth CLIENT_ID:CLIENT_SECRET --google-oauth CLIENT_ID:CLIENT_SECRET --server URL
To skip admin authorization on startup:
./start.sh --skip-auth
License and pricing
License: MIT. Open source (pricing type: open_source).
Based on the project's public README and repository metadata.