# sub2api | Wesley Liddick | Knowledge Base | Instagit

Sub2API 一站式开源中转服务，让 Claude、Openai 、Gemini、Grok订阅统一接入，支持拼车共享，更高效分摊成本，原生工具无缝使用。

GitHub Stars: 39k

Repository: https://github.com/Wei-Shaw/sub2api

---

## Articles

### [How to Configure Object Storage for Asynchronous Image Tasks in Sub2API](/Wei-Shaw/sub2api/how-is-object-storage-configured-for-asynchronous-image-tasks-in-sub2api)

Learn how to configure object storage for asynchronous image tasks in Sub2API. Offload large images to S3-compatible services to keep Redis memory usage low.

- Tags: how-to-guide
- Published: 2026-08-23

### [How to Use the Asynchronous Image Task Endpoints in Sub2API: Complete REST API Reference](/Wei-Shaw/sub2api/what-are-the-endpoints-for-asynchronous-image-tasks-in-sub2api)

Discover Sub2API's asynchronous image task endpoints. Learn how to manage batch image generation and retrieve results using the /v1/images/batches REST API.

- Tags: api-reference
- Published: 2026-08-23

### [How Sub2API Handles Asynchronous Image Generation: Task-Based Architecture and Implementation](/Wei-Shaw/sub2api/how-does-sub2api-handle-asynchronous-image-generation-tasks)

Discover how Sub2API manages asynchronous image generation using background tasks and status endpoints. Learn about its task-based architecture and implementation for efficient processing.

- Tags: internals
- Published: 2026-08-23

### [Sub2API Order Statuses: Complete Guide to Payment State Constants](/Wei-Shaw/sub2api/what-are-the-different-order-statuses-in-sub2apis-payment-system)

Explore the 13 Sub2API order status constants for payment state management. Understand every possible payment lifecycle stage from creation to completion, refund, or failure.

- Tags: api-reference
- Published: 2026-08-23

### [Sub2API Payment System Load Balancing Strategies: Round Robin and Least Daily Amount](/Wei-Shaw/sub2api/what-load-balancing-strategies-are-available-in-the-sub2api-payment-system)

Explore Sub2API payment load balancing strategies like Round Robin and Least Daily Amount. Learn how to optimize request distribution for your payment system.

- Tags: best-practices
- Published: 2026-08-23

### [What Are the Supported Payment Providers for Sub2API? Complete Implementation Guide](/Wei-Shaw/sub2api/what-are-the-supported-payment-providers-for-sub2api)

Explore supported payment providers for Sub2API including EasyPay, Alipay, WeChat Pay, Stripe, and Airwallex. Get a complete implementation guide to integrate seamlessly.

- Tags: how-to-guide
- Published: 2026-08-23

### [Which AI Platforms Are Supported by Sub2API’s Composite Groups?](/Wei-Shaw/sub2api/which-ai-platforms-are-supported-by-sub2apis-composite-groups)

Discover which AI platforms Sub2API's Composite Groups support including Anthropic, Gemini, OpenAI, and Grok. Route requests dynamically without binding API keys.

- Tags: getting-started
- Published: 2026-08-23

### [How Sub2API Calculates Costs Based on Tokens: Inside `usage_billing.go`](/Wei-Shaw/sub2api/how-does-sub2api-calculate-costs-based-on-tokens)

Discover how Sub2API calculates API costs using token counts in usage_billing.go. Learn about input/output volume and rate tier pricing for accurate billing.

- Tags: internals
- Published: 2026-08-23

### [Concurrency Control Mechanisms in Sub2API: A Deep Dive into Channel-Based Rate Limiting](/Wei-Shaw/sub2api/what-are-the-concurrency-control-mechanisms-in-sub2api)

Explore Sub2API's concurrency control: buffered Go channels, mutex-protected state, and lifecycle primitives enforce per-user limits and protect AI providers from overload.

- Tags: deep-dive
- Published: 2026-08-23

### [How Sub2API Performs Rate Limiting: Architecture and Implementation](/Wei-Shaw/sub2api/how-does-sub2api-perform-rate-limiting)

Discover how Sub2API implements rate limiting. Learn about its architecture, the centralized RateLimitService, and how it enforces per-account quotas using X-RateLimit headers.

- Tags: architecture
- Published: 2026-08-23

### [Nginx Configuration Required for Sub2API Sticky Sessions](/Wei-Shaw/sub2api/what-nginx-configuration-is-required-for-sub2apis-sticky-sessions)

Learn the Nginx configuration required for Sub2API sticky sessions. Use the sticky directive and sub2api_session cookie to route clients to the same backend instance.

- Tags: how-to-guide
- Published: 2026-08-23

### [How Sub2API Implements Sticky Sessions for Account Selection](/Wei-Shaw/sub2api/how-does-sub2api-implement-sticky-sessions-for-account-selection)

Discover how Sub2API implements sticky sessions for account selection using a TTL-bound mechanism. Learn how requests are bound to a specific account and automatically cleared.

- Tags: internals
- Published: 2026-08-23

### [What Upstream Account Types Does Sub2API Support?](/Wei-Shaw/sub2api/what-are-the-different-types-of-upstream-accounts-supported-by-sub2api)

Discover Sub2API upstream account types. It supports OAuth subscriptions, static API keys, and Gemini service accounts for seamless AI provider integration.

- Tags: api-reference
- Published: 2026-08-23

### [How the Sub2API Frontend Is Structured: A Complete Vue 3 Architecture Guide](/Wei-Shaw/sub2api/how-is-the-frontend-of-sub2api-structured)

Explore the modular Vue 3 architecture of the Sub2API frontend. Learn about its Vite setup, routing, Pinia stores, API wrapper, and reusable components within the Wei-Shaw/sub2api repo.

- Tags: architecture
- Published: 2026-08-23

### [What Is the Purpose of the Ent ORM in Sub2API?](/Wei-Shaw/sub2api/what-is-the-purpose-of-the-ent-orm-in-sub2api)

Discover the purpose of the Ent ORM in Sub2API. It acts as the data-access layer, providing type-safe Go structs and query builders for PostgreSQL with compile-time checked CRUD and migrations.

- Tags: deep-dive
- Published: 2026-08-23

### [Which Upstream AI Services Does Sub2API Support? Complete Provider Guide](/Wei-Shaw/sub2api/what-upstream-ai-services-does-sub2api-support)

Discover which upstream AI services Sub2API supports including OpenAI, Claude, Gemini, Grok, and more. Explore this comprehensive provider guide to unify your AI access.

- Tags: provider-guide
- Published: 2026-08-23

