[UNTESTED] [netherguy4/opencode-gemini-failover-provider] 1 endpoint(s)
ChatGPT
API Proxy/ChatGPT
2,184 characters
Status: [UNTESTED]
Endpoints found:
http://127.0.0.1:8787/v1/chat/completions
http://127.0.0.1:8787/api/chat
Source: https://github.com/netherguy4/opencode-gemini-failover-provider
# OpenCode Gemini Local Failover Provider
A local OpenAI-compatible proxy that forwards `/v1/chat/completions` to the Gemini OpenAI-compatible endpoint and rotates across multiple Gemini API keys on auth, billing, quota, and transient errors. Also exposes a minimal Ollama-compatible API so VS Code's GitHub Copilot Chat can use Gemini as a BYOK model.
Supports text, tool/function calling, images/vision, and common document attachments (PDF, DOCX, XLSX, TXT, MD, JSON, CSV, HTML).
## Feature matrix
| Feature | Status |
| --- | --- |
| Text chat | Supported |
| Tools / function calling | Supported |
| Streaming (SSE / NDJSON) | Supported |
| Images via OpenAI `image_url` | Supported (PNG, JPEG, WebP, GIF) |
| Images via Ollama `images[]` | Supported |
| PDF | Supported via text extraction |
| DOCX | Supported via text extraction |
| XLSX | Supported via sheet extraction |
| TXT, MD, JSON, CSV | Supported (injected as text) |
| HTML | Supported (tags stripped) |
| Audio / video | Unsupported (returns clear error) |
| Remote file URLs | Disabled by default (security) |
| Native Gemini Files API | Disabled by default |
## What it does and what it doesn't
This proxy is meant to improve reliability, not to bypass per-key limits.
- One upstream request per client request — no fan-out across keys at the same time.
- Honors `Retry-After` if the provider returns it.
- Puts a key/model pair on cooldown after quota errors; `5xx` and timeouts still cool down the whole key.
- Disables a key after `401`. `403` goes on cooldown.
- Does not retry ordinary `400` responses (bad request, unsupported model, etc.).
- Extracts text from file attachments locally and injects it into the prompt.
- Validates image and file sizes; rejects oversized/unsupported attachments with clear errors.
- Never silently drops user-provided attachments.
## Quick start (Docker)
```bash
cp .env.example .env
```
Fill in `.env`:
```env
GEMINI_API_KEYS=key1,key2,key3
LOCAL_PROVIDER_KEY=local-dev-key
DE