gpt2giga documentation
gpt2giga is a FastAPI compatibility gateway that accepts requests in the OpenAI, Anthropic, and Gemini formats and forwards them to GigaChat. It is useful when a client, editor, agent framework, or SDK can talk to the OpenAI/Anthropic/Gemini API, but the real backend must be GigaChat.
Default local address:
http://localhost:8090
What the proxy covers
| Capability | Where to read |
|---|---|
Quick start via Docker Compose or uv | Quickstart |
| Supported OpenAI, Anthropic, Gemini, and LiteLLM routes | API compatibility |
Behavior of extra_headers, extra_query, extra_body, and optional fields | Client parameters |
| GigaChat built-in tools and their mapping to OpenAI/Anthropic/Gemini | Built-in tools |
| Environment variables, authentication, limits, metrics, observability | Configuration |
| Compose profiles, Traefik, nginx, Postgres, OpenSearch, Phoenix | Deployment |
| Runtime logs, traffic logs, admin API, debug translate | Operations |
| Editor, agent, SDK, and reverse-proxy setup | Integrations |
Current API surface
Public routes are available at the root and under versioned prefixes:
/chat/completions,/v1/chat/completions,/v2/chat/completions/responses,/v1/responses,/v2/responses/embeddings,/v1/embeddings,/v2/embeddings/messages,/v1/messages,/v2/messages/v1beta/models/{model}:generateContentand compatible Gemini paths/models,/model/info,/health,/ping
The backend selection rule is the same for OpenAI-, Anthropic-, and
Gemini-compatible routes: /v1/... always sends chat-like requests to the
GigaChat v1 contract, /v2/... sends them to the GigaChat v2 contract, and the
root path without /v1 or /v2 uses GPT2GIGA_GIGACHAT_API_MODE=v1|v2.
OpenAI Files/Batches, Anthropic Message Batches, and Gemini Files/Batches are prepared in the code but intentionally not mounted until end-to-end execution is available in the upstream SDK/backend.
Fast path
- Copy
.env.exampleto.env. - Fill in
GIGACHAT_CREDENTIALS,GIGACHAT_SCOPE,GIGACHAT_MODEL. - Run
docker compose --env-file .env -f deploy/base.yaml --profile DEV up -d. - Check
curl http://localhost:8090/health. - Point the SDK at
http://localhost:8090/v1orhttp://localhost:8090/v2for an explicit backend contract, or athttp://localhost:8090if the root should followGPT2GIGA_GIGACHAT_API_MODE.
For developers
- Normalized messages describes the experimental layer of protocol-independent models.
- Logging and observability sets the boundaries between runtime logs, traffic logs, metrics, and traces.
- Adding a provider or protocol gives a checklist for extending the public protocol surface and upstream providers.