Skip to content

OpenAI Compatible API for OpenCode Zen Free Models with JavaFX GUI

Notifications You must be signed in to change notification settings

CodyEdwin/jai-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JAI API

OpenAI Compatible API for OpenCode Zen Free Models with JavaFX GUI

Overview

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.

Supported Models

  • grok-code (Grok Code Fast)
  • glm-4.7-free
  • minimax-m2.1-free
  • big-pickle
  • kimi-k2

Prerequisites

  • Java 17+
  • JavaFX runtime (included in some JDK distributions like Liberica JDK Full, or install separately)
  • Internet connection (calls OpenCode Zen API)

Building

mvn clean package -DskipTests

Running

API Server

Run the API server:

./run-api.sh

or

java -jar api/target/api-1.0.0-jar-with-dependencies.jar

The API will be available at http://localhost:8080/v1

GUI Client

In a separate terminal, run the GUI client:

./run-gui.sh

or

java --module-path /path/to/javafx/lib --add-modules javafx.controls,javafx.fxml -jar gui/target/gui-1.0.0-jar-with-dependencies.jar

Important: 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.jar

Note: The GUI requires JavaFX runtime components. If using a standard JDK, install OpenJFX:

API Endpoints

  • POST /v1/chat/completions - Chat completions (OpenAI compatible, supports streaming)
  • GET /v1/models - List available models

Usage

  1. Start the API server in one terminal
  2. Start the GUI client in another terminal
  3. Select a model and start chatting with real-time streaming!

OpenAI Compatibility

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.

About

OpenAI Compatible API for OpenCode Zen Free Models with JavaFX GUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published