Java SDK for OpenAI APIs
Top 14.3% on sourcepulse
This Java SDK provides a comprehensive client for interacting with OpenAI's official APIs, targeting developers who need to integrate advanced AI capabilities like GPT-3.5/4, DALL-E 3, and TTS into their Java applications. It offers support for streaming output, GPT plugins, and network connectivity, simplifying the process of leveraging OpenAI's models.
How It Works
The SDK utilizes OkHttpClient for network requests, allowing for extensive customization of clients, including proxy settings, timeouts, and interceptors. It supports both standard and streaming API responses through OpenAiClient
and OpenAiStreamClient
respectively. Key features include dynamic API key management, token calculation (via tiktoken-java
), and robust error handling for API key issues.
Quick Start & Requirements
com.unfbx:chatgpt-java
.Highlighted Details
Maintenance & Community
The project is community-maintained. Further community interaction and support can be found via the linked WeChat public account (chatgpt-java
).
Licensing & Compatibility
The project is licensed under the Apache License 2.0, permitting commercial use and integration with closed-source applications.
Limitations & Caveats
The project is described as "unofficial" and community-maintained, implying potential for bugs or breaking changes. While it supports various OpenAI models, users should verify compatibility with the latest API versions.
1 year ago
1 week