OpenAI-Java is the official Java client library provided by OpenAI for interacting with the OpenAI API. It is designed to make it easier for Java applications to call endpoints like chat completions, embeddings, function calling, streaming, and other model services using idiomatic Java patterns. You configure the client (often via environment variables or system properties), then build parameter objects (e.g. ChatCompletionCreateParams) and invoke methods like client.chat().completions().create(...) to send requests in a type-safe way. The library also supports streaming APIs, where the response arrives in chunks, using helpers like ChatCompletionAccumulator to accumulate partial responses into a full object. For complex use cases (e.g. structured outputs, function calling), it provides schema support, JSON annotations, and schema validation.

Features

  • Request/response POJOs for the GPT APIs
  • Basic retrofit client for the GPT endpoints, includes the api module
  • A basic service class that creates and calls the client. This is the easiest way to get started
  • Example project using the service
  • Data classes only
  • OpenAiService

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow OpenAI-Java

OpenAI-Java Web Site

Other Useful Business Software
ServiceDesk Plus, a world-class IT and enterprise service management platform Icon
ServiceDesk Plus, a world-class IT and enterprise service management platform

Design, automate, deliver, and manage critical IT and business services

Best in class online service desk software. Offer your customers world-class services with ServiceDesk Plus Cloud, the easy-to-use SaaS service desk software from ManageEngine, the IT management division of Zoho. Track and manage IT tickets efficiently, resolve issues faster, and ensure end-user satisfaction with the cloud-based IT ticketing system used by over 100,000 IT service desks worldwide. Manage the complete life cycle of IT incidents, problems, changes, and projects with out of the box ITIL workflows. Create support SLAs, define escalation levels, and ensure compliance. Automate ticket dispatch, categorization, classification, and assignment based on predefined business rules, and set up notifications and alerts for timely ticket resolution. Reduce walk ins and unnecessary tickets by giving your users more control. Enable end users to access IT services through your service catalog in the self-service portal. Help users create and track tickets and search for solutions.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of OpenAI-Java!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Java

Related Categories

Java Libraries, Java API Clients

Registered

2023-08-02