sub2api

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

16 articles 39k View on GitHub ↗
16 articles
How to Configure Object Storage 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.

how-to-guide
Aug 23, 2026
How to Use the Asynchronous Image Task Endpoints in Sub2API: Complete REST API Reference

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

api-reference
Aug 23, 2026
How Sub2API Handles Asynchronous Image Generation: Task-Based Architecture and Implementation

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

internals
Aug 23, 2026
Sub2API Order Statuses: Complete Guide to Payment State Constants

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

api-reference
Aug 23, 2026
Sub2API Payment System Load Balancing Strategies: Round Robin and Least Daily Amount

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

best-practices
Aug 23, 2026
What Are the Supported Payment Providers for Sub2API? Complete Implementation Guide

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

how-to-guide
Aug 23, 2026
Which AI Platforms Are Supported by Sub2API’s Composite Groups?

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

getting-started
Aug 23, 2026
How Sub2API Calculates Costs Based on Tokens: Inside `usage_billing.go`

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.

internals
Aug 23, 2026
Concurrency Control Mechanisms in Sub2API: A Deep Dive into Channel-Based Rate Limiting

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

deep-dive
Aug 23, 2026
How Sub2API Performs Rate Limiting: Architecture and Implementation

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

architecture
Aug 23, 2026
Nginx Configuration Required for Sub2API 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.

how-to-guide
Aug 23, 2026
How Sub2API Implements 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.

internals
Aug 23, 2026

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →