OpenAI Compatible API for OpenCode Zen Free Models with JavaFX GUI
JAI provides an OpenAI-compatible REST API that interfaces with OpenCode's free Zen models, along with a ChatGPT-style JavaFX GUI for easy interaction. No API keys required for the free models.
- grok-code (Grok Code Fast)
- glm-4.7-free
- minimax-m2.1-free
- big-pickle
- kimi-k2
- Java 17+
- JavaFX runtime (included in some JDK distributions like Liberica JDK Full, or install separately)
- Internet connection (calls OpenCode Zen API)
mvn clean package -DskipTestsRun the API server:
./run-api.shor
java -jar api/target/api-1.0.0-jar-with-dependencies.jarThe API will be available at http://localhost:8080/v1
In a separate terminal, run the GUI client:
./run-gui.shor
java --module-path /path/to/javafx/lib --add-modules javafx.controls,javafx.fxml -jar gui/target/gui-1.0.0-jar-with-dependencies.jarImportant: Make sure the API server is running first, as the GUI will check for it and refuse to start if the API is not available. or if JavaFX is installed separately:
java --module-path /path/to/javafx/lib --add-modules javafx.controls,javafx.fxml -jar gui/target/gui-1.0.0-jar-with-dependencies.jarNote: The GUI requires JavaFX runtime components. If using a standard JDK, install OpenJFX:
- Ubuntu/Debian:
sudo apt install openjfx - Or download JavaFX SDK from https://gluonhq.com/products/javafx/
POST /v1/chat/completions- Chat completions (OpenAI compatible, supports streaming)GET /v1/models- List available models
- Start the API server in one terminal
- Start the GUI client in another terminal
- Select a model and start chatting with real-time streaming!
The API mimics OpenAI's chat completions endpoint, so you can use it with any OpenAI-compatible client by pointing to http://localhost:8080/v1. It proxies requests to OpenCode's Zen API for the free models.