gigachat-bridge
A local proxy exposing GigaChat through OpenAI- and Anthropic-compatible APIs so it can drive Claude Code, aider and other agents
Install
.\run.ps1PowerShell. The first run creates .venv, installs dependencies and .env; add GIGACHAT_AUTH_KEY and run the script again.
This is third-party code. Review the repository files before installing.
What it does
The proxy runs on a local port, accepts OpenAI Chat Completions and Anthropic Messages requests and forwards them to GigaChat. It fetches the access token, which GigaChat expires after 30 minutes, refreshes it early and retries once on 401. Unsupported fields are dropped, foreign model names are mapped to the chosen GigaChat model, and tool calls are translated to GigaChat functions and back, including streaming. It also serves model listing, embeddings and token counting endpoints.
Who it is for. For developers who need to run CLI agents on Sber's GigaChat model.
Good fit when
- You need to run Claude Code or aider on GigaChat
- An agent with a static key breaks when the GigaChat token expires
- You need an OpenAI-compatible GigaChat endpoint for your code or Continue
Not a fit when
- You need long multi-step agent tasks: the author notes GigaChat fails more often there
- You need images or documents: the proxy does not pass them through
Example request
Start gigachat-bridge and run Claude Code on the GigaChat-2-Max modelLimitations
Requires a GigaChat project authorization key from developers.sber.ru. Quick start and certificate scripts are PowerShell for Windows. TLS verification is off by default; for safe use, build the Russian root certificate bundle and enable GIGACHAT_VERIFY_SSL. Thinking blocks are dropped. The repository has no license.
How to disable. Stop the proxy process and unset ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_MODEL or OPENAI_BASE_URL.
Security check
- All code and agent session context is sent to GigaChat
- TLS verification is off by default
- Stores the GigaChat authorization key in .env
README in short
The README explains the need: GigaChat tokens expire quickly and static-key agents break. It gives a run.ps1 quick start, compares the two GigaChat hosts with different model sets, and shows connection examples for the openai SDK, aider, curl, Continue and Claude Code. It lists endpoints and every request transformation, and covers certificates, .env settings and a smoke test against a fake GigaChat.
FAQ
Why does GigaChat-3-Ultra not work?
It is only on the api.giga.chat host. Set GIGACHAT_API_BASE=https://api.giga.chat/v1 and GIGACHAT_MODEL=GigaChat-3-Ultra.
Should ANTHROPIC_BASE_URL include /v1?
No, Claude Code appends it itself.
Related
Open-source personal AI assistant on your own machine: answers in Telegram, Slack, Discord and WhatsApp, extended with skills and plugins
A self-improving agent from Nous Research with a TUI, messaging gateway, cron jobs and skills it writes itself
Anthropic's coding agent for the terminal, IDE and GitHub: understands your codebase, runs tasks and handles git
OpenAI's coding agent that runs locally in your terminal, with IDE and desktop versions