Configs2026年6月2日·1 分钟阅读

One API — Unified LLM Gateway for OpenAI, Claude, and Gemini

A self-hosted API management and distribution system that aggregates multiple LLM providers behind a single OpenAI-compatible interface with load balancing, rate limiting, and token quota management.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
One API LLM Gateway
先审查命令
npx -y tokrepo@latest install 1039cfd7-5ec1-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

Introduction

One API is a self-hosted LLM API gateway that lets you access OpenAI, Anthropic Claude, Google Gemini, and dozens of other providers through a single OpenAI-compatible endpoint. Teams use it to centralize API key management, enforce usage quotas, and switch between providers without changing application code.

What One API Does

  • Aggregates 30+ LLM providers behind one unified API endpoint compatible with the OpenAI format
  • Manages API keys, user tokens, and per-user quota limits through a web dashboard
  • Load-balances requests across multiple provider channels with automatic failover
  • Tracks token usage and costs per user, per channel, and per model
  • Supports streaming responses, function calling, and vision models across providers

Architecture Overview

One API is a Go application backed by SQLite or MySQL. The web dashboard is built with React. Incoming requests are routed through a channel selection layer that picks the best available provider based on priority, weight, and health status. Each channel wraps a specific provider adapter that translates between the OpenAI format and the native API format.

Self-Hosting & Configuration

  • Deploy via Docker, Docker Compose, or a single binary on Linux, macOS, or Windows
  • Set the database with SQL_DSN for MySQL or use the default embedded SQLite
  • Add provider channels through the admin UI with API keys and model mappings
  • Create user tokens with optional rate limits, expiration, and quota caps
  • Enable Redis for distributed rate limiting in multi-instance deployments

Key Features

  • OpenAI-compatible endpoint means zero code changes for existing applications
  • Built-in billing system tracks token consumption and supports recharge codes
  • Channel priority and weight system for cost optimization across providers
  • Automatic retry and failover when a provider returns errors or timeouts
  • Model mapping lets you expose custom model names that route to any backend

Comparison with Similar Tools

  • LiteLLM — Python-based proxy; One API offers a full admin UI with quota management
  • OpenRouter — Managed service; One API is fully self-hosted with no third-party dependency
  • Portkey AI Gateway — Focused on observability; One API emphasizes multi-tenant billing
  • API Gateway (Kong/APISIX) — General-purpose; One API is purpose-built for LLM token economics
  • Helicone — Logging-focused proxy; One API adds load balancing and provider aggregation

FAQ

Q: Which LLM providers does One API support? A: OpenAI, Azure OpenAI, Anthropic Claude, Google Gemini, AWS Bedrock, Mistral, DeepSeek, Ollama, and many more. New providers are added regularly.

Q: Can I use One API with existing OpenAI SDK code? A: Yes. Point the base_url to your One API instance and use the issued token as the API key. No other changes are needed.

Q: Does it support streaming? A: Yes. Streaming, function calling, and multimodal (vision) requests are fully supported across compatible providers.

Q: How does quota management work? A: Admins set token quotas per user. Each request deducts from the quota based on actual token usage reported by the provider.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产