Mar 7, 2025
SDKs
Kotlin
Java
Java/Kotlin general availability

Tomer Aberbach
Software Engineer
The Java and Kotlin SDK generators are now generally available, with improved support for complex OpenAPI specs and several new features.
Convenient builders for complex objects: The SDKs now include helper methods to make building complex objects easier, such as
.addCard(Card)alongside.cards(List<Card>)or.addUserMessage(String)for a discriminated union like{role: 'user', message: string}.Automatic cleanup for unreachable objects: The
HttpClientand other resources are now closed automatically when no longer in use, even if the user forgets to call.close()(available in Java 9+).File uploads: Multipart form data is fully supported, even with nested file fields. Builders like
FileCreateParams.builder().file(...)acceptbyte[],InputStream, orPath, and stream data directly to the API, without buffering in-memory whenever possible.Binary responses: Methods like
client.files().retrieve(...)return anHttpResponsewith a.body()stream. This is ideal for handling binary data without loading it all into memory.Raw response access: Easily access headers and more for any method call; for example,
client.cards().withRawResponse().create(...)returns anHttpResponseFor<Card>with.headers(),.parse(), etc.SSE and JSONL streaming: Endpoints with streaming responses are now supported (e.g.,
client.chat().completions().createStreaming()).Jackson compatibility: The SDKs work with Jackson versions as old as 2.13.4, minimizing the chance of version conflicts in downstream applications.
We have a slew of additional improvements to our Java SDKs planned; please reach out to [email protected] with anything you’d be most excited to see.