Jvm-openai - A minimalistic Java client for the OpenAI API

Hi, for any JVM developers, last few weeks I worked on a Java client for the OpenAI API focusing on simplicity and minimal dependencies (only Jackson )

I have tried to cover all functionalities and request/response types/parameters and as of last version 0.4.0, it also supports the Beta APIs.

Would be cool to get feedback. Be free to open an issue or even a PR if you feel like it.

Good day. :slightly_smiling_face:

2 Likes

Nice! :laughing:

Unfortunately, the API changes quite frequently - and it’s difficult to trust third party libraries to stay maintained.

Do you have any strategies to deal with this?

A working, self-maintaining library would be so cool

Thanks for the comment.

I will try to keep track of any changes in https://platform.openai.com/docs/changelog . I hope it gets maintained.

I would like also to get a hold of a testing environment (if any??) and run a bigger suite of automated integration tests to capture any changes.

Also if library gets traction, I hope to get PRs from external contributors.

Just FYI, I think you’re in pretty questionable territory there with the name of your project. It’s catchy and cute, but probably too similar to “ChatGPT.”

Haven’t thought about it, but given it’s open-source project and actually based on the OpenAI API not a competing product, don’t think it should be a problem in my opinion.

From last version 0.5.0 the project has been renamed to jvm-openai

More information on Release v0.5.0 · StefanBratanov/jvm-openai · GitHub

1 Like

Released new version 0.5.2 covering the latest API changes at GitHub - openai/openai-openapi: OpenAPI specification for the OpenAI API

Also worked on a test which verifies the Java objects against the openapi yaml spec file. Makes it much easier to capture breaking changes.

2 Likes

For anyone interested in contributing to the project added CONTRIBUTING.md to the repo: jvm-openai/CONTRIBUTING.md at master · StefanBratanov/jvm-openai · GitHub

Released new version 0.6.0 covering the latest API changes at GitHub - openai/openai-openapi: OpenAPI specification for the OpenAI API

Released new version 0.6.1 (removing instance_id parameter and adding ability to configure a request timeout) Release v0.6.1 · StefanBratanov/jvm-openai · GitHub

Released new version 0.6.2 with some small improvements

Released new version 0.7.0 which covers the latest API changes, few improvements as well as support for Assistants Streaming Release v0.7.0 · StefanBratanov/jvm-openai · GitHub

Also the project got its first external contributor :slight_smile:

Released new version 0.8.0 with support for the Batch API as well as other spec changes Release v0.8.0 · StefanBratanov/jvm-openai · GitHub

Released new version 0.9.0 with support for Assistants API v2 as well as couple of other changes Release v0.9.0 · StefanBratanov/jvm-openai · GitHub

Released new version 0.9.1 with support for stream_options as well as a fix for an issue reported by users Release v0.9.1 · StefanBratanov/jvm-openai · GitHub

1 Like

Released new version 0.9.2 with some fixes/spec updates Release v0.9.2 · StefanBratanov/jvm-openai · GitHub

1 Like

Released new version 0.9.3 with latest spec updates Release v0.9.3 · StefanBratanov/jvm-openai · GitHub

1 Like

Released new version 0.10.0 with support for the Uploads API and couple of other small changes Release v0.10.0 · StefanBratanov/jvm-openai · GitHub

1 Like

Released new version 0.11.0 with support for structured outputs, support for the new Administration endpoints and couple of other small changes Release v0.11.0 · StefanBratanov/jvm-openai · GitHub

I am interested if any project is using this library and is following this thread. It would be good to get a feedback. I am contemplating adding a sponsor button to the repository in order to possibly get some funding.