Practical overview
When it fits
Use it when a Kotlin application needs a client library for OpenAI API requests, especially when coroutine support or multiplatform project structure matters.
Who it is for
- Kotlin application developers integrating OpenAI API calls.
- Teams building coroutine-based features that use OpenAI.
- Developers adding OpenAI API access to supported Kotlin multiplatform projects.
Documented uses
- Make API requests for chat, responses, models, images, embeddings, files, audio and other listed operations.
- Integrate OpenAI calls into coroutine-based Kotlin application code.
- Set up a shared client dependency in a multiplatform project and select an HTTP engine for each target.
Requirements & limits
- The library requires an HTTP engine from Ktor; the project does not prescribe one universal engine.
- Gradle is required for multiplatform support; Maven use is described for the JVM client, and the BOM is not supported for Maven projects.
- The repository lists Assistants, Threads, Messages, Runs and Vector Stores as beta, while Completions, Fine-tunes and Edits are deprecated.
- The client is unofficial and is not affiliated with or endorsed by OpenAI.
- Opt-in live integration tests can generate billable API traffic; live tests are disabled by default.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Add the client to a Gradle project
Set up the OpenAI Kotlin client and its Ktor engine dependency in a Gradle project.
Before you start
- A Gradle project
- Maven Central configured as a repository
- An OpenAI API key for making API requests
- A chosen Ktor HTTP client engine
Steps
Add Maven Central to the project repositories.
Add the OpenAI Kotlin client dependency, using the version appropriate to the project.
Choose and add a Ktor engine dependency.
Create an OpenAI client instance configured with the API key, then use it to make API requests.
Expected outcome
The Gradle project has the documented client and HTTP-engine dependencies and can be configured to make OpenAI API requests.
Guide limitations
- The dependency version shown in the README is 4.1.0; confirm the version appropriate to your project before adopting it.
- An API key is required for API requests. The project recommends using environment variables for the key.
- This setup guide does not document a particular request implementation.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 11 October 2026
- Original website title
- aallam/openai-kotlin · Official homepage title · retained in its source language

