Unofficial OAuth session support for Claude, OpenAI, and Gemini models via CLIProxyAPI.
This package extends OpenRouter.jl to route requests through CLIProxyAPI, a local proxy that provides API endpoints using OAuth authentication from your existing subscriptions.
using Pkg
Pkg.add(url="https://github.com/sixzero/OpenRouterCLIProxyAPI.jl")- Install (or update) CLIProxyAPI:
Re-run the same command to upgrade to the latest version (config is preserved). After upgrading, restart the service:
curl -fsSL https://raw.githubusercontent.com/brokechubb/cliproxyapi-installer/refs/heads/master/cliproxyapi-installer | bashsystemctl --user restart cliproxyapi.service
- Authenticate with your provider(s):
After authenticating, restart the service:
# OpenAI (Codex) — requires ChatGPT Pro/Plus subscription ~/cliproxyapi/cli-proxy-api -config ~/cliproxyapi/config.yaml -codex-login # Claude — requires Claude Pro/Max subscription ~/cliproxyapi/cli-proxy-api -config ~/cliproxyapi/config.yaml -claude-login # Gemini (Google) ~/cliproxyapi/cli-proxy-api -config ~/cliproxyapi/config.yaml -login # Qwen ~/cliproxyapi/cli-proxy-api -config ~/cliproxyapi/config.yaml -qwen-login # Add -no-browser to print the URL instead of opening a browser
systemctl --user restart cliproxyapi.service
using OpenRouter
using OpenRouterCLIProxyAPI
# One-time setup (registers provider + injects endpoints)
setup_cli_proxy!()
response = aigen("Hello!", "cli_proxy_api:anthropic/claude-opus-4.7")setup_cli_proxy!(
base_url = "http://localhost:8317/v1",
api_key_env_var = "CLIPROXYAPI_API_KEY",
provider_name = "cli_proxy_api",
mutate = false # true = overwrite existing endpoints
)~/cliproxyapi/cli-proxy-api --version 2>&1 | head -1# Re-run installer (preserves config, upgrades binary)
curl -fsSL https://raw.githubusercontent.com/brokechubb/cliproxyapi-installer/refs/heads/master/cliproxyapi-installer | bash
# Then restart
systemctl --user restart cliproxyapi.servicesystemctl --user restart cliproxyapi.service
systemctl --user status cliproxyapi.serviceNote: Models are hardcoded in the binary — new models only appear after updating to a release that includes them. Models also only show if your logged-in account has access.
If a model isn't in the upstream release yet, see docs/CUSTOM_BINARY.md for how to build and deploy a patched binary.
Anthropic: claude-opus-4.7, claude-opus-4.6, claude-sonnet-4.6, claude-opus-4.5, claude-sonnet-4.5, claude-haiku-4.5, claude-opus-4.1, claude-sonnet-4
OpenAI: gpt-5.4, gpt-5.3-codex, gpt-5.3-codex-spark, gpt-5.2-codex, and older models