[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7590":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":23,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":36,"readmeContent":37,"aiSummary":38,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":39,"discoverSource":40},7590,"openai-kotlin","aallam\u002Fopenai-kotlin","aallam","OpenAI API client for Kotlin with multiplatform and coroutines capabilities.","",null,"Kotlin",1837,237,29,59,0,2,10,20.13,"MIT License",false,"main",true,[25,26,27,28,29,30,31,32,33,34,35],"api","chatgpt","client","coroutines","dall-e","gpt","kotlin","llm","multiplatform","openai","whisper","2026-06-12 02:01:41","# OpenAI API client for Kotlin\n\n[![Maven Central](https:\u002F\u002Fimg.shields.io\u002Fmaven-central\u002Fv\u002Fcom.aallam.openai\u002Fopenai-client?color=blue&label=Download)](https:\u002F\u002Fcentral.sonatype.com\u002Fnamespace\u002Fcom.aallam.openai)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FAallam\u002Fopenai-kotlin?color=yellow)](LICENSE.md)\n[![Documentation](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocs-api-a97bff.svg?logo=kotlin)](https:\u002F\u002Fmouaad.aallam.com\u002Fopenai-kotlin\u002F)\n\nKotlin client for [OpenAI's API](https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference) with multiplatform and coroutines\ncapabilities.\n\n## 📦 Setup\n\n1. Install OpenAI API Kotlin client by adding the following dependency to your `build.gradle` file:\n\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation \"com.aallam.openai:openai-client:4.1.0\"\n}\n```\n\n2. Choose and add to your dependencies one of [Ktor's engines](https:\u002F\u002Fktor.io\u002Fdocs\u002Fhttp-client-engines.html).\n\n#### BOM\n\nAlternatively, you can use [openai-client-bom](\u002Fopenai-client-bom)  by adding the following dependency to your `build.gradle` file\n\n```groovy\ndependencies {\n    \u002F\u002F import Kotlin API client BOM\n    implementation platform('com.aallam.openai:openai-client-bom:4.1.0')\n\n    \u002F\u002F define dependencies without versions\n    implementation 'com.aallam.openai:openai-client'\n    runtimeOnly 'io.ktor:ktor-client-okhttp'\n}\n```\n\n### Multiplatform\n\nIn multiplatform projects, add openai client dependency to `commonMain`, and choose\nan [engine](https:\u002F\u002Fktor.io\u002Fdocs\u002Fhttp-client-engines.html) for each target.\n\n### Maven\n\nGradle is required for multiplatform support, but there's nothing stopping you from using the jvm client in a Maven\nproject. You still need to add to your dependencies one\nof [Ktor's engines](https:\u002F\u002Fktor.io\u002Fdocs\u002Fhttp-client-engines.html).\n\n\u003Cdetails>\n \u003Csummary>Setup the client with maven\u003C\u002Fsummary>\n\n```xml\n\u003Cdependencies>\n    \u003Cdependency>\n        \u003CgroupId>com.aallam.openai\u003C\u002FgroupId>\n        \u003CartifactId>openai-client-jvm\u003C\u002FartifactId>\n        \u003Cversion>4.1.0\u003C\u002Fversion>\n    \u003C\u002Fdependency>\n            \n    \u003Cdependency>\n        \u003CgroupId>io.ktor\u003C\u002FgroupId>\n        \u003CartifactId>ktor-client-okhttp-jvm\u003C\u002FartifactId>\n        \u003Cversion>3.0.0\u003C\u002Fversion>\n        \u003Cscope>runtime\u003C\u002Fscope>\n    \u003C\u002Fdependency>\n\u003C\u002Fdependencies>\n```\n\n\u003C\u002Fdetails>\n\nThe BOM is not supported for Maven projects.\n\n## ⚡️ Getting Started\n\n> [!NOTE]\n> OpenAI encourages using environment variables for the API key.\n> [Read more](https:\u002F\u002Fhelp.openai.com\u002Fen\u002Farticles\u002F5112595-best-practices-for-api-key-safety).\n\nCreate an instance of `OpenAI` client:\n\n```kotlin\nval openai = OpenAI(\n    token = \"your-api-key\",\n    timeout = Timeout(socket = 60.seconds),\n    \u002F\u002F additional configurations...\n)\n```\n\nOr you can create an instance of `OpenAI` using a pre-configured `OpenAIConfig`:\n\n```kotlin\nval config = OpenAIConfig(\n    token = apiKey,\n    timeout = Timeout(socket = 60.seconds),\n    \u002F\u002F additional configurations...\n)\n\nval openAI = OpenAI(config)\n```\n\nUse your `OpenAI` instance to make API requests. [Learn more](guides\u002FGettingStarted.md).\n\n### Supported features\n\n- [Responses](guides\u002FGettingStarted.md#responses)\n- [Models](guides\u002FGettingStarted.md#models)\n- [Chat](guides\u002FGettingStarted.md#chat)\n- [Images](guides\u002FGettingStarted.md#images)\n- [Embeddings](guides\u002FGettingStarted.md#embeddings)\n- [Files](guides\u002FGettingStarted.md#files)\n- [Fine-tuning](guides\u002FGettingStarted.md#fine-tuning)\n- [Moderations](guides\u002FGettingStarted.md#moderations)\n- [Audio](guides\u002FGettingStarted.md#audio)\n- [Batch](guides\u002FGettingStarted.md#batch)\n\n#### Beta\n\n- [Assistants](guides\u002FGettingStarted.md#assistants)\n- [Threads](guides\u002FGettingStarted.md#threads)\n- [Messages](guides\u002FGettingStarted.md#messages)\n- [Runs](guides\u002FGettingStarted.md#runs)\n- [Vector Stores](guides\u002FGettingStarted.md#vector-stores)\n\n#### Deprecated\n- [Completions](guides\u002FGettingStarted.md#completions)\n- [Fine-tunes](guides\u002FGettingStarted.md#fine-tunes)\n- [Edits](guides\u002FGettingStarted.md#edits)\n\n*Looking for a tokenizer? Try [ktoken](https:\u002F\u002Fgithub.com\u002Faallam\u002Fktoken), a Kotlin library for tokenizing text.*\n\n## 📚 Guides\n\nGet started and understand more about how to use OpenAI API client for Kotlin with these guides:\n\n- [Getting Started](guides\u002FGettingStarted.md)\n- [Chat & Tool Calls](guides\u002FChatToolCalls.md)\n- [FileSource Guide](guides\u002FFileSource.md)\n- [Assistants](guides\u002FAssistants.md)\n\n## ℹ️ Sample apps\n\nSample apps are available under `sample`, please check the [README](sample\u002FREADME.md) for running instructions.\n\n## 🔒 ProGuard \u002F R8\n\nThe specific rules are [already bundled](openai-core\u002Fsrc\u002FjvmMain\u002Fresources\u002FMETA-INF\u002Fproguard\u002Fopenai.pro) into the Jar which can be interpreted by R8 automatically.\n\n## 📸 Snapshots\n\n[![Snapshot](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdynamic\u002Fxml?url=https:\u002F\u002Fcentral.sonatype.com\u002Frepository\u002Fmaven-snapshots\u002Fcom\u002Faallam\u002Fopenai\u002Fopenai-client\u002Fmaven-metadata.xml&label=snapshot&color=red&query=.\u002F\u002Fversioning\u002Flatest)](https:\u002F\u002Fcentral.sonatype.com\u002Frepository\u002Fmaven-snapshots\u002Fcom\u002Faallam\u002Fopenai\u002Fopenai-client\u002F)\n\n\u003Cdetails>\n \u003Csummary>Learn how to import snapshot version\u003C\u002Fsummary>\n\nTo import snapshot versions into your project, add the following code snippet to your gradle file:\n\n```groovy\nrepositories {\n   \u002F\u002F...\n   maven { url 'https:\u002F\u002Fcentral.sonatype.com\u002Frepository\u002Fmaven-snapshots\u002F' }\n}\n```\n\n\u003C\u002Fdetails>\n\n## 🛠️ Troubleshooting\n\nFor common issues and their solutions, check the [Troubleshooting Guide](TROUBLESHOOTING.md).\n\n## 🧪 Testing\n\n`openai-client` tests are live integration tests and can generate billable API traffic.\n\n- Default (non-billable): live tests are disabled.\n- Opt-in live tests: set `OPENAI_LIVE_TESTS=1` and `OPENAI_API_KEY`.\n\nExamples:\n\n```bash\n# Free\u002Foffline checks\n.\u002Fgradlew :openai-core:jvmTest :openai-core:jsTest :openai-core:wasmJsTest :openai-core:apiCheck :openai-client:apiCheck\n\n# Live smoke (billable)\nOPENAI_LIVE_TESTS=1 OPENAI_API_KEY=... .\u002Fgradlew :openai-client:jvmTest --tests \"*.TestModels\"\n```\n\n## ⭐️ Support\n\nAppreciate the project? Here's how you can help:\n\n1. **Star**: Give it a star at the top right. It means a lot!\n2. **Contribute**: Found an issue or have a feature idea? Submit a PR.\n3. **Feedback**: Have suggestions? Open an issue or start a discussion.\n\n## 📄 License\n\nOpenAI Kotlin API Client is an open-sourced software licensed under the [MIT license](LICENSE.md).\n**This is an unofficial library, it is not affiliated with nor endorsed by OpenAI**. Contributions are welcome.\n","openai-kotlin 是一个为 Kotlin 开发的 OpenAI API 客户端，支持多平台和协程功能。该项目允许开发者通过简洁的 Kotlin 代码调用 OpenAI 的各种服务，如 GPT、DALL-E 和 Whisper 等，充分利用 Kotlin 的异步编程模型提高应用性能。它特别适合需要跨平台（包括 JVM、JS 和 Native）集成 AI 功能的应用场景，例如聊天机器人、内容生成工具或语音识别软件。此外，项目提供了详细的文档和易于集成的 Gradle 或 Maven 配置示例，便于快速上手。","2026-06-11 03:13:12","top_language"]