yym68686/uni-api

This is a project that unifies the management of LLM APIs. It can call multiple backend services through a unified API interface, convert them to the OpenAI format uniformly, and support load balancing. Currently supported backend services include: OpenAI, Anthropic, DeepBricks, OpenRouter, Gemini, Vertex, etc.

What it solves

uni-api is a lightweight, configuration-based API gateway that unifies multiple large language model (LLM) providers into a single OpenAI-compatible interface. It eliminates the need for a complex frontend and commercial features found in larger API management tools, making it easier for individuals to manage and call various backend services through one endpoint.

How it works

Users configure their API channels via a YAML file (api.yaml). The system then maps these diverse backend services—such as OpenAI, Anthropic, Gemini, Vertex AI, Azure, AWS, and others—to a unified OpenAI format. It supports advanced request routing, including load balancing (weighted, sequential, or round-robin), automatic retries, and a "cooling" mechanism that temporarily disables failing channels.

Who it’s for

It is designed for individuals and developers who want a simple, no-frontend API station to unify their various LLM keys and providers without the overhead of a complex management interface.

Highlights

  • Broad Provider Support: Integrates OpenAI, Anthropic, Gemini, Vertex, Azure, AWS, xAI, Cohere, Groq, Cloudflare, and OpenRouter.
  • OpenAI Compatibility: Converts multiple backend services into standard OpenAI format interfaces (e.g., /v1/chat/completions, /v1/embeddings).
  • Native Feature Support: Supports native tool use (function calling) and image recognition for major providers.
  • Intelligent Routing: Features channel-level weighted load balancing, automatic retries, and automatic channel cooling on failure.
  • Fine-grained Control: Offers model-specific timeout settings, rate limiting (per minute/hour/day/month/year), and wildcard-based permission control for API keys.
  • Safety: Includes OpenAI moderation moral review to reduce the risk of backend API bans.

Related

  • Project
  • Project
  • Project
  • Project
  • Project