chatgpt-java
Free3.6k
FreeFree tier
Inputs: textOutputs: text
About chatgpt-java
chatgpt-java is an unofficial Java SDK for seamless integration with OpenAI's ChatGPT APIs, including GPT-3.5, GPT-4, GPT-4o, and GPT-4o-mini. It is designed to be ready-to-use with simple setup, supporting features such as function calling, streaming dialogue, context management, token counting, multi-key polling, and proxy/reverse proxy support. The SDK is open-source and maintained on GitHub by PlexPt, providing a straightforward builder pattern for configuration and usage.
Key Features
GPT-3.5, GPT-4, GPT-4o, and GPT-4o-mini support
Function calling (Custom Chat Functions)
Streaming dialogue support
Context management
Token counting
Multi-key polling
Proxy and reverse proxy support
Builder pattern for easy configuration
Pros & Cons
Pros
- Free and open-source (MIT license)
- Supports latest GPT models including GPT-4o and GPT-5
- Simple and clear builder API for setup
- Built-in proxy support for users in regions with restrictions
- Includes token counting and streaming functionality
- Active GitHub repository with 3.6k stars and frequent updates
Cons
- Unofficial SDK, not maintained by OpenAI
- Requires an OpenAI API key with associated usage costs
- Requires Java programming knowledge
- Limited documentation beyond README and code examples
Best For
Building AI-powered Java applications that require conversational AIIntegrating ChatGPT into enterprise Java systemsDeveloping chatbots or virtual assistants in JavaPrototyping and experimenting with OpenAI's GPT models in JavaEducational projects for learning API integration with Java
FAQ
What is chatgpt-java?
chatgpt-java is an unofficial Java SDK that provides a simple way to integrate OpenAI's ChatGPT APIs (GPT-3.5, GPT-4, GPT-4o, GPT-4o-mini) into Java applications.
Is chatgpt-java free to use?
Yes, the SDK itself is free and open-source. However, using it requires an OpenAI API key which may have associated charges.
How do I set up proxy for use in China?
You can configure HTTP or SOCKS5 proxy via the builder, e.g., 'Proxys.http("127.0.0.1", 1081)' or 'Proxys.socks5("127.0.0.1", 1080)'.
Does chatgpt-java support streaming responses?
Yes, the SDK supports streaming dialogue (streaming output from the API) as mentioned in the feature list.
What models are supported?
Currently supports GPT-3.5, GPT-4, GPT-4o, and GPT-4o-mini. The repository also mentions GPT-5 API support.