Status: [UNTESTED] Endpoints found: http://localhost:4096/v1/chat/completions http://proxy.lan:8080 http://localhost:4096/v1/responses Source: https://github.com/grigio/opencode-openai-api-proxy # opencode-openai-api-proxy — Docker Image with OpenAI Compatibility This Docker image provides a complete and optimized environment to run the [OpenCode AI](https://opencode.ai) server. It includes an integrated Translation Layer (Proxy) that makes OpenCode compatible with any tool that supports the OpenAI API. ## 🌟 Key Features - **OpenAI Compatibility Proxy:** Use OpenCode as if it were the OpenAI service. Compatible with LibreChat, Dify, TypingMind, etc. - **Streaming Support:** Real-time responses via Server-Sent Events (SSE). - **Dynamic Model Mapping:** Automatic support for multiple providers in `provider/model` format. - **Native API Exposed:** Full access to OpenCode's original features and web interface. - **Secure by Default:** Authentication via Bearer Token for the Proxy and Basic Auth for the native API. - **Data Persistence:** Volumes configured to keep sessions, database, and settings. - **Permission Support (NAS):** Supports `PUID` and `PGID` variables to avoid permission issues on network volumes. --- ## 🚀 Getting Started ### 1. Via Docker Compose (Recommended) Use the provided [`docker-compose.yml`](./docker-compose.yml) to spin up the service quickly: 1. Define your password in a `.env` file (or directly in the compose file): ```env OPENCODE_SERVER_PASSWORD=your_secret_password ``` 2. Start the container: ```bash docker-compose up -d ``` ### 2. Via Docker Run ```bash docker run -d \ --name opencode-server \ -p 4096:4096 \ -p 4097:4097 \ -e OPENCODE_SERVER_PASSWORD=your_secret_password \ -e PUID=1000 \ -e PGID=1000 \ -v opencode_data:/home/node/.local/share/opencode \ -v opencode_config:/home/node/.config/opencode \ local/opencode-openai-api-proxy:latest ``` --- ## 🔌 Connectivity & Ports | Port | Service | Description | Authentication | | :--- | :--- | :--- | :--- | | **4096** | **OpenAI Proxy** | OpenAI SDK/Tools compatible endpoint | `Bearer ` | | **4097** | **OpenCode