Skip to main content
Installation
Use createResponse, createChatCompletion, createEmbedding, and listModels for JSON requests. Pass a Map or JsonNode; parse JSON strings before passing them to wrapper methods.

Retries and errors

Retries default to zero. setMaxRetries retries safe GET/HEAD requests; writes and streaming requests are not replayed. HTTP errors expose status, body, headers, and request ID through Client.ApiException.

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.
Last modified on October 18, 2026