Compared: 9 subscription-to-API tools
The best ways to use a Claude or ChatGPT subscription as an API
9 tools turn a Claude, ChatGPT, Gemini or Kimi plan into an API in 2026: free self-hosted proxies like CLIProxyAPI and sub2api, hosted gateways from $0 to $129 a month, and local routers that only work inside coding agents. Plan2API is hosted, free for 50 requests a day, and encrypts your logins so only your API key unlocks them.
- Tools compared
- 9, checked October 2026
- Free to self-host
- CLIProxyAPI, sub2api
- Hosted gateway prices
- $0 to $129 a month
- Plan2API Free
- 50 requests a day
Updated
The 9 tools at a glance
The table below compares all 9 options by what they connect, which API formats they speak, where they run, and what they cost as of October 29, 2026.
These tools split into three categories. Hosted gateways give you an endpoint right away with nothing to deploy, though the service holds your connected logins. Self-hosted proxies are free and flexible, but you have to run and secure the server yourself, while local routers only work inside specific coding agents and give you no API to call from your own code.
| Tool | Type | Subscriptions | API formats | Price |
|---|---|---|---|---|
| Plan2API | Hosted | Claude, ChatGPT (Codex), Gemini, Kimi | OpenAI Chat Completions, images on paid plans | Free for 50 requests a day, Pro $12 a month |
| CLIProxyAPI | Self-hosted, MIT, Go | Claude Code, Codex, Gemini and Antigravity, Kimi, Grok and more | Chat Completions, Responses, Claude Messages, Gemini | Free |
| sub2api | Self-hosted, LGPL-3.0, Go | Claude, ChatGPT (Codex), Gemini, Antigravity, Grok, Kimi | Chat Completions, Responses, Claude Messages, Gemini | Free |
| OpenLLM | Local daemon plus hosted dashboard | Claude, Codex, Kimi through the daemon | OpenAI and Anthropic compatible | Free up to 50M tokens a month, Pro $30 a month |
| LLM To API | Hosted | Codex; Claude, Kimi Code and Grok in preview | Chat Completions, Responses, Anthropic Messages | $9.90 or $19.90 a month |
| SubToAPI | Hosted | Claude only | Its own / | 9 euros a month, Team 19 and Scale 49 euros a seat |
| ProxyLLM | Hosted Codex, Claude bridge on your server | ChatGPT (Codex), Claude | OpenAI compatible | $129 a month |
| Subrouter | Local CLI plugin | 10 kinds, incl. Claude, ChatGPT, Kimi Code | None, works inside OpenCode and Pi | Free |
| AutoRouter | Mac app | ChatGPT, Claude | None, works inside Codex and Claude Code | Free routing, Pro $20 a month |
Hosted gateways
Plan2API gives you one OpenAI-compatible p2a_ key for Claude, ChatGPT (Codex), Gemini and Kimi, with automatic failover when you connect more than one account of the same provider and a $0 Free tier for 50 chat requests a day with no card required. The catch is that it only serves /v1/chat/completions (plus image endpoints on paid plans) and doesn't offer /v1/responses or Anthropic /v1/messages, so Claude Code and the Codex CLI can't run through it.
LLM To API is a hosted gateway at https://gateway.llmtoapi.com/v1 that exposes Chat Completions, Responses and Anthropic Messages formats. Codex subscriptions are supported, while Claude, Grok, Kimi Code and GLM Coding Plan subscription integrations are in preview with real subscription authorization and requests still awaiting verification. Registration is free, but connecting a real account requires a paid plan starting at $9.90 a month via PayPal, and the Starter tier caps you at 2 total concurrent requests across 2 provider accounts.
SubToAPI is a Claude-only hosted service at api.subtoapi.app with tool use, team seats (19 euros per seat a month for up to 10 seats, or 9 euros a month for Solo), and a 3-day free trial without a card. It uses its own request format, with /v1/messages and a streaming conversation endpoint, and three model aliases (fast, balanced, best) instead of model ids.
ProxyLLM is built for AI agencies and runs the official Codex CLI inside a private container signed in to your ChatGPT account behind an OpenAI-compatible endpoint at https://api.proxyllm.ai/v1, with fallback to a second Codex account or your own OpenAI API key. The catch is the $129 a month membership after a 7-day trial, and if you want to use Claude, you still have to run a Claude Code bridge on a server you own.
Self-hosted and local proxies
CLIProxyAPI is a free, MIT-licensed Go proxy (default port 8317, with an optional EasyCLIProxyAPI desktop UI) that speaks OpenAI Chat Completions and Responses, Claude Messages, and Gemini formats across Claude, Codex, Gemini, Antigravity, Kimi, Grok, Meta Muse and Devin. Because it exposes /v1/messages and /v1/responses and does round-robin load balancing across accounts, both Claude Code and the Codex CLI can run through it. The catch is that there's no official hosted version, so you have to run and secure the server yourself, and your logins sit as auth files on that machine (in ~/.cli-proxy-api by default).
sub2api is an LGPL-3.0 Go gateway with a Vue dashboard, built to distribute subscription quota by handing out its own API keys with token-level billing, per-user rate limits, and built-in payments through Stripe, Alipay, WeChat Pay and EasyPay. It covers Claude, ChatGPT and Codex, Gemini, Antigravity, Grok and Kimi across /v1/messages, /v1/chat/completions, /v1/responses and /v1beta, but you have to run PostgreSQL 15+ and Redis 7+ yourself. Its own README also warns that "Using this project may violate the terms of service of Anthropic and other upstream providers" and puts all risk on the user.
OpenLLM pairs a hosted dashboard with a local daemon (openllmd) that keeps your Claude, Codex and Kimi logins on your device, serving OpenAI- and Anthropic-compatible APIs at http://127.0.0.1:8787/v1 with a Free tier of 50M non-cached tokens a month across 2 devices. The catch is that subscription logins only work on the machine running the local daemon rather than on OpenLLM's hosted endpoint, and openllmd is source-available under the Business Source License 1.1 instead of an open-source license.
Routers for coding agents, without an API
Subrouter is a free npm CLI (@subrouter/cli) with plugins that move the OpenCode and Pi coding agents to your next subscription when one hits its usage limit, rotating across 10 plan types including Claude Pro and Max, ChatGPT Plus and Pro, SuperGrok, GitHub Copilot and Kimi Code. Its docs list no API server, so you can't call it from your own scripts or apps, and its docs state it's for personal use only.
AutoRouter is a Mac app in beta (macOS 14 or later) that adds itself as a model inside Claude Code and the Codex app and CLI, picking a model per turn across your ChatGPT and Claude plans. Routing across your own subscriptions is free, with a $20 a month Pro plan that includes $20 of usage for other models at the provider's price plus 10%, but requests pass through AutoRouter's servers and it stores up to 4,000 characters of the message that opens each turn to review routing.
How to choose
- If you want to run Claude Code or the Codex CLI through a proxy on your subscription, you need Anthropic Messages or OpenAI Responses, which means self-hosting CLIProxyAPI or sub2api, or running OpenLLM's local daemon.
- If you don't want to run or secure a server, pick a hosted gateway.
- If you only use Claude and want to share access across a team without managing model IDs, SubToAPI is built for that.
- If you run production Codex workflows and want the official Codex CLI isolated in a container with account fallback, look at ProxyLLM.
- If you only want your coding agent to keep going when one plan runs out of quota, use Subrouter (for OpenCode and Pi) or AutoRouter (on a Mac with Claude Code and Codex).
- If you want one OpenAI-compatible key for Claude, ChatGPT, Gemini and Kimi to call from your own code with a free tier, use Plan2API.
Whichever tool you pick, every request runs through your own subscription account, and providers' terms generally limit plans to personal use. As Subrouter's docs note, routing subscription traffic to serve other people or tenants is against the terms of use of most subscription providers, so the account risk stays with you.
Where Plan2API fits
Plan2API is the hosted option for developers who want a standard OpenAI-compatible API on top of their own plans without deploying a proxy. You sign in with Google at plan2api.com/connect, connect a Claude Pro or Max plan, a ChatGPT subscription through Codex, a Google AI Pro or Ultra account for Gemini, or a Kimi membership, and call https://api.plan2api.com/v1 with a single p2a_ key using model prefixes like claude/, codex/, gemini/ and kimi/.
Your connected logins are encrypted with HPKE (X25519) and AES-256-GCM so only your p2a_ API key can unlock them, the key's secret is never stored, and your prompts and outputs are never stored either (see the security details for how encryption works). The Free plan is $0 with 1 connected subscription and 50 chat requests a day, Pro is $12 a month ($99 a year) with 3 subscriptions and no daily request cap, and Scale is $29 a month ($249 a year) with 25 subscriptions.
Here is a streaming request to Opus 5.5 on your own Claude plan.
curl https://api.plan2api.com/v1/chat/completions \
-H "Authorization: Bearer $PLAN2API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude/claude-opus-5-5",
"messages": [{"role": "user", "content": "Write a haiku about rate limits."}],
"stream": true
}'Use the AI subscriptions you already pay for as one OpenAI-compatible API key.
- Free: 1 subscription, 50 requests a day, no card
- Pro: $12 a month
FAQ
What is the best way to use a Claude Max subscription as an API?
It depends on whether you want to run a server yourself. If you're fine self-hosting, CLIProxyAPI is free and gives you both Claude Messages and OpenAI formats, while a hosted gateway like Plan2API gives you an OpenAI-compatible p2a_ key with nothing to deploy, and SubToAPI covers Claude alone with team seats and fast, balanced and best aliases.
Is there a free option?
Yes, several tools cost nothing. CLIProxyAPI and sub2api are free to self-host on your own hardware, OpenLLM is free up to 50M non-cached tokens a month on 2 devices, Subrouter is a free CLI plugin, and AutoRouter routes across your own plans for free. If you want a hosted API without running a server, Plan2API's Free tier gives you 50 chat requests a day on 1 connected subscription with no credit card required.
Which tools work with Claude Code or the Codex CLI?
Claude Code needs the Anthropic /v1/messages format and the Codex CLI needs the OpenAI /v1/responses format. CLIProxyAPI and sub2api expose both endpoints for self-hosters, OpenLLM serves both through its local openllmd daemon, LLM To API offers both on its hosted gateway, and AutoRouter plugs directly into both tools on macOS; Plan2API only serves /v1/chat/completions (and images on paid tiers), so it doesn't work as a backend for Claude Code or the Codex CLI.
Are these tools allowed by Anthropic and OpenAI?
Each provider's own terms of service decide what is allowed, and subscription plans are generally limited to personal use. sub2api's README explicitly warns that using it may violate the terms of service of Anthropic and other upstream providers, and Subrouter's docs point out that routing subscription traffic to serve other people breaks most providers' terms, so any account risk stays with the account holder.
Hosted or self-hosted: which is safer?
Self-hosting keeps your tokens off third-party services, but you have to secure the machine yourself, and CLIProxyAPI stores logins as auth files on that server (~/.cli-proxy-api by default). Hosted gateways hold your credentials for you, so check how they store them; Plan2API encrypts connected logins with HPKE (X25519) and AES-256-GCM so that only your p2a_ API key can unlock them, and it never stores that key's secret.
Can I share one subscription with a team?
A couple of tools are built for team sharing: sub2api lets you issue your own API keys to users with per-user rate limits and token billing, and SubToAPI's Team plan shares a Claude connection across up to 10 seats for 19 euros per seat a month. Keep in mind that provider terms generally limit subscriptions to personal use, so check your plan's terms before sharing a single account across multiple people.
Sources
- CLIProxyAPI on GitHubgithub.com
- sub2api on GitHubgithub.com
- OpenLLM pricingopenllm.sh
- LLM To APIllmtoapi.com
- SubToAPIsubtoapi.app
- ProxyLLMproxyllm.ai
- Subrouter docssubrouter.org
- AutoRouterautorouter.com