The current source includes retry controls and response metadata that are absent from the older 3.0.0 artifact on Maven Central. Build the pinned source below to use the current SDK. Installation
Supported requests
UsecreateResponse, createChatCompletion, createEmbedding, and listModels for JSON requests. Pass a Map or JsonNode; parse JSON strings before passing them to wrapper methods.
For file uploads, audio transcription/translation, and image edits, use the direct multipart HTTP examples in this guide. The SDK’s JSON helpers do not encode multipart file bodies.
Streaming
streamResponse and rawClient().requestLines return SSE lines as they arrive. Close the stream with try-with-resources and handle event names, data lines, and completion markers in your application.
The
createSpeech wrapper expects JSON and cannot decode binary audio. Use rawClient().requestBytes for speech output.