Skip to content
OPEN SOURCE · SELF-HOSTED · AI GATEWAY

SmartAPI
Self-hosted AI gateway

Connect your clients to the accounts you already have. SmartAPI handles routing, waiting and recoverable failures.

Go + SQLite · AMD64 / ARM64 · Apache-2.0
01 / AI FIRST

AI First

Official Skill, full functionality

Official Skill capabilities

From models, accounts and routes to request diagnostics, quota management and daily operations, agents access SmartAPI’s full management capabilities through the official Skill.

Install the official Skill →

Logical models: built around your business

Logical modelsIllustrative routing, not live traffic. Compatible routes and recovery budgets apply. 05 / Logical modelsSMARTAPIHHermes AgentClient exampleOpenAIModel AAnthropicModel BDeepSeekModel Cmodel: workSame client configurationSmartAPIwork → Awork → BChange the upstream model between requests. Keep the business endpoint.

Define model endpoints for your business. Change upstream models, accounts and routes inside SmartAPI while keeping your application configuration unchanged.

Configure logical models →
02 / PERFORMANCE

Extreme Performance

Lower memory usage

Peak memory comparison

Peak working set: 30.8–34.5 MiB. About 49%–55% lower than CLIProxyAPI and 92%–93% lower than the sub2api stack in this benchmark.

Lower CPU usage

Peak CPU comparison

SmartAPI’s peak CPU usage is close to CLIProxyAPI and lower than the sub2api stack: 146.6%–157.1%, 151.0%–151.2% and 390.2%–406.3%, respectively.

Same-source baseline, not a 1.0.0 release-image test · OpenAI Chat Mock · ARM64 · concurrency 32 · 1 KiB / 64 KiB responses · 2026-10-30. Methods & full data →

03 / RELIABILITY

Reliable Requests

Automatic failover

Automatic fallbackIllustrative routing, not live traffic. Compatible routes and recovery budgets apply. 03 / Automatic fallbackSMARTAPICodexChatGPT · APrimaryChatGPT · BFallbackOpenAI APINext routeSmartAPI503OKPrimary fails; a compatible fallback completes the request.

When the primary upstream fails, automatically try a compatible fallback.

Queue requests, see fewer 429s

Queue through rate limitsIllustrative routing, not live traffic. Compatible routes and recovery budgets apply. 04 / Queue through rate limitsSMARTAPIHHermes AgentChatGPTConcurrency 2Claude CodeAnother route101202303Pending tasksQUEUESmartAPI010203429 · WAIT1 / 2 · GORequests wait during a rate limit, then leave the queue in order.

Wait within configured budgets when capacity is unavailable, then continue when it opens.

Automatic resets and quota protection

AutoResetIllustrative routing, not live traffic. Compatible routes and recovery budgets apply. 06 / AutoResetSMARTAPIRESET CREDITAvailableExpires in 10 minCodexUpstream accountUse 1 creditRecord the outcomeThreshold: 20 minSmartAPICHECKREDEEMRECORDEDExisting Codex credits only. Reset eligibility is decided upstream.

Automatically redeem available Codex reset credits and reduce requests to exhausted accounts.

Configure AutoReset →
GET STARTED

Two commands to start.

Create the administrator, add an upstream and issue a client key. No source build or separate database is required.

Installation, backups and upgrades →
TERMINAL
curl -fsSLo compose.yaml https://github.com/hulkbig/smartapi/releases/latest/download/compose.yaml
docker compose up -d --no-build

Open localhost:17910 to initialize.

Before you start

Does SmartAPI include accounts or credits?

No. Use your own API keys or supported subscriptions. Calls, retries and capability probes can incur upstream charges.

Will Thinking continue until success?

Waiting is bounded by recovery budgets. A client’s Thinking display is not evidence of continuous upstream reasoning.

Are all combinations verified?

No. Some account drivers have offline coverage only. Verify tools, streaming and follow-up turns on your own routes.

Apache-2.0 · Third-party notices included