← all repositories
TheoKanning/openai-java

The OpenAI Java wrapper that froze in mid-2024

It was a clean, modular Java bridge to OpenAI’s APIs—until the maintainer archived it in June 2024 and walked away.

openai-java
Not currently ranked — collecting fresh signals.
star history

What it does openai-java is a multi-module Java client for OpenAI’s GPT family. It offers api for request/response POJOs, client for a Retrofit-based HTTP layer, and service for a simplified OpenAiService entry point. Together they cover chat completions, embeddings, images, audio, files, fine-tuning, moderations, and the Assistants API, plus helpers for OpenAI function calling.

The interesting bit The library lets you choose your level of abstraction, from raw data classes to a ready-made service. The FunctionExecutor class is a nice touch, letting you wire Java methods directly into OpenAI’s function-calling schema without manual JSON wrangling.

Key highlights

  • Broad endpoint coverage: chat, completions, embeddings, images, audio, files, fine-tuning, moderations, and assistants.
  • Three-tier architecture: api for POJOs, client for Retrofit, service for convenience.
  • Built-in function-calling support via ChatFunction and FunctionExecutor.
  • Handles streaming responses, with an explicit shutdownExecutor() hook to kill the background thread.
  • MIT licensed and accumulated 4,739 stars before archival.

Caveats

  • Archived as of June 6, 2024; no bug fixes, updates, or support will ever arrive.
  • Several OpenAI endpoints (Engines, Legacy Fine-Tunes) were already deprecated by OpenAI and remain only until the API shuts them down.
  • The OpenAiService convenience class is intentionally bare-bones; retry logic, async calls, or custom headers require dropping down to the OpenAiApi Retrofit layer directly.

Verdict Worth a look if you want a stable, well-organized snapshot to fork for an internal Java project. If you need an actively maintained SDK that tracks OpenAI’s latest changes, this is a dead end.

Frequently asked

What is TheoKanning/openai-java?
It was a clean, modular Java bridge to OpenAI’s APIs—until the maintainer archived it in June 2024 and walked away.
Is openai-java open source?
Yes — TheoKanning/openai-java is open source, released under the MIT license.
What language is openai-java written in?
TheoKanning/openai-java is primarily written in Java.
How popular is openai-java?
TheoKanning/openai-java has 4.7k stars on GitHub.
Where can I find openai-java?
TheoKanning/openai-java is on GitHub at https://github.com/TheoKanning/openai-java.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.