{"id":49325542,"url":"https://github.com/reactiveclown/openai-webflux-java","last_synced_at":"2026-05-29T21:00:54.993Z","repository":{"id":149932563,"uuid":"611203173","full_name":"reactiveclown/openai-webflux-java","owner":"reactiveclown","description":"Reactive WebFlux OpenAI API Client in Java","archived":false,"fork":false,"pushed_at":"2023-10-23T10:15:00.000Z","size":144,"stargazers_count":23,"open_issues_count":3,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2023-10-23T11:27:56.758Z","etag":null,"topics":["api","chat-gpt","gpt","gpt-3","java","library","maven","openai","spring","springboot","springbootstarter","webflux"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reactiveclown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-08T10:37:45.000Z","updated_at":"2023-10-23T11:27:58.396Z","dependencies_parsed_at":null,"dependency_job_id":"5cb2b094-8a5b-4aa1-a85e-52b0e07c86e9","html_url":"https://github.com/reactiveclown/openai-webflux-java","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/reactiveclown/openai-webflux-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiveclown%2Fopenai-webflux-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiveclown%2Fopenai-webflux-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiveclown%2Fopenai-webflux-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiveclown%2Fopenai-webflux-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactiveclown","download_url":"https://codeload.github.com/reactiveclown/openai-webflux-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactiveclown%2Fopenai-webflux-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33670211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","chat-gpt","gpt","gpt-3","java","library","maven","openai","spring","springboot","springbootstarter","webflux"],"created_at":"2026-04-26T20:00:31.588Z","updated_at":"2026-05-29T21:00:54.982Z","avatar_url":"https://github.com/reactiveclown.png","language":"Java","funding_links":[],"categories":["人工智能"],"sub_categories":["LLM客户端"],"readme":"![Maven Central](https://img.shields.io/maven-central/v/io.github.reactiveclown/openai-webflux-client-spring-boot-starter?color=green)\n![Stars](https://img.shields.io/github/stars/reactiveclown/openai-webflux-java?style=social)\n# Reactive OpenAI API client library.\n\nThis is the Reactive OpenAI client library.\n\nIt was written using WebFlux and Spring Boot. The library also contains pre-configured Spring Boot starter for easier\nusage.\n\nThe library is unofficial and community-maintained. Feel free to join the development.\n\n# Table of Contents\n\n- ### [Supported APIs](#supported)\n- ### [Installation](#installations)\n- ### [Usage](#usages)\n- ### [Contributing](#contributings)\n- ### [License](#licence)\n\n## \u003ca id=\"supported\"\u003e\u003c/a\u003eSupported APIs\n\n- [Models service](#models-service)\n- [Completions service](#completions-service)\n- [Chat service](#chat-service)\n- [Edits service](#edits-service)\n- [Images service](#images-service)\n- [Embeddings service](#embeddings-service)\n- [Audio service](#audio-service)\n- [Files service](#files-service)\n- [Fine-tunes service](#fine-tunes-service)\n- [Moderations service](#moderations-service)\n\n## \u003ca id=\"installations\"\u003e\u003c/a\u003eInstallation\n\nDependency import via **Maven**:\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.reactiveclown\u003c/groupId\u003e\n    \u003cartifactId\u003eopenai-webflux-client-spring-boot-starter\u003c/artifactId\u003e\n    \u003cversion\u003e0.9.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nDependency import via **Gradle**:\n\n```implementation 'io.github.reactiveclown:openai-webflux-client-spring-boot-starter:0.9.1'```\n\n\nAfter adding the dependency remember to add yor OpenAI api key to the application.properties.\n```properties\ncom.github.reactiveclown.openai.apiKey=OPENAI_API_KEY\n```\n\nYou can also add the Organization id and change baseUrl by providing next configuration variables.\nBut this step is not mandatory one.\n```properties\ncom.github.reactiveclown.openai.organizationId=OPENAI_ORGANIZATION_ID\ncom.github.reactiveclown.openai.baseUrl=OPENAI_CUSTOM_BASE_URL\n```\n\n## \u003ca id=\"usages\"\u003e\u003c/a\u003eUsage\n\nHere you can find some usage examples.\nAlso, kindly use the official documentation in order to get more information about parameters.\n\n---\n#### \u003ca id=\"models-service\"\u003e\u003c/a\u003eModels service\n\n[OpenAI Models Docs](https://platform.openai.com/docs/api-reference/models)\n\nModels service is used to retrieve the list of models or information about specific model.\n\n```java\n@Service\npublic class ExampleService {\n\n    private final ModelsService service;\n\n    public ExampleService(ModelsService service) {\n        this.service = service;\n    }\n\n    public Mono\u003cListModelsResponse\u003e listModels() {\n        return service.listModels();\n    }\n\n    public Mono\u003cRetrieveModelResponse\u003e retrieveModel(String modelName) {\n        return service.retrieveModel(modelName);\n    }\n}\n```\n---\n\n#### \u003ca id=\"completions-service\"\u003e\u003c/a\u003eCompletions service\n\n[OpenAI Completions Docs](https://platform.openai.com/docs/api-reference/completions)\n\nCompletions service is used to complete the text. Fell free to play around with builder parameters.\n\n```java\n@Service\npublic class ExampleService {\n\n    private final CompletionsService service;\n\n    public ExampleService(CompletionsService service) {\n        this.service = service;\n    }\n\n    public Mono\u003cCreateCompletionResponse\u003e createCompletion() {\n        return service.createCompletion(\n                CreateCompletionRequest\n                        .builder(\"babbage\")\n                        .n(2)\n                        .bestOf(1)\n                        .build());\n    }\n}\n```\n---\n\n#### \u003ca id=\"chat-service\"\u003e\u003c/a\u003eChat service\n\n[OpenAI Chat Docs](https://platform.openai.com/docs/api-reference/chat)\n\nChat service is used to chat with the chat models. Fell free to play around with builder parameters.\n\n```java\n@Service\npublic class ExampleService {\n\n    private final ChatService service;\n\n    public ExampleService(ChatService service) {\n        this.service = service;\n    }\n\n    public Mono\u003cCreateChatCompletionResponse\u003e createChatCompletion() {\n        return service.createChatCompletion(\n                CreateChatCompletionRequest\n                        .builder(\"gpt-3.5-turbo\", List.of(new MessageData(\"user\",\"do something\")))\n                        .n(3)\n                        .build());\n    }\n}\n```\n---\n\n#### \u003ca id=\"edits-service\"\u003e\u003c/a\u003eEdits service\n\n[OpenAI Edits Docs](https://platform.openai.com/docs/api-reference/edits)\n\nEdits service is used to make an edits to the provided input. Fell free to play around with builder parameters.\n\n```java\n@Service\npublic class ExampleService {\n\n    private final EditsService service;\n\n    public ExampleService(EditsService service) {\n        this.service = service;\n    }\n\n    public Mono\u003cCreateEditResponse\u003e createEdit() {\n        return service.createEdit(\n                CreateEditRequest\n                        .builder(\"babbage\", \"Add one digit after every word\")\n                        .input(\"One Two Three\")\n                        .build());\n    }\n}\n```\n---\n\n#### \u003ca id=\"images-service\"\u003e\u003c/a\u003eImages service\n\n[OpenAI Images Docs](https://platform.openai.com/docs/api-reference/images)\n\nImage service is used to generate a different images and their transformations.\n\u003e ⚠️ As for now, methods that are requiring images are blocking. In the nearest future it is planned to add async FilePart implementation.\n\n```java\n@Service\npublic class ExampleService {\n\n    private final ImagesService service;\n\n    public ExampleService(ImagesService service) {\n        this.service = service;\n    }\n\n    //Non-blocking\n    public Mono\u003cCreateImageResponse\u003e createImage() {\n        return service.createImage(\n                CreateImageRequest\n                        .builder(\"Generate a digital art of Ukraine\")\n                        .build());\n    }\n\n    //Blocking\n    public Mono\u003cCreateImageVariationResponse\u003e createImageVariation() {\n        return service.createImageVariation(\n                CreateImageVariationRequest\n                        .builder(\"src/main/resources/exampleImage.png\")\n                        .size(\"512x512\")\n                        .build());\n    }\n\n    //Blocking\n    public Mono\u003cCreateImageEditResponse\u003e createImageEdit() {\n        return service.createImageEdit(\n                CreateImageEditRequest\n                        .builder(\"src/main/resources/exampleImage.png\", \"Generate a green fields\")\n                        .mask(\"src/main/resources/exampleMask.png\")\n                        .build());\n    }\n}\n```\n---\n\n#### \u003ca id=\"embeddings-service\"\u003e\u003c/a\u003eEmbeddings service\n\n[OpenAI Embeddings Docs](https://platform.openai.com/docs/api-reference/embeddings)\n\nEmbedding service is used to create embeddings. Fell free to play around with builder parameters.\n\n```java\n@Service\npublic class ExampleService {\n\n    private final EmbeddingsService service;\n\n    public ExampleService(EmbeddingsService service) {\n        this.service = service;\n    }\n\n    public Mono\u003cCreateEmbeddingsResponse\u003e createEmbeddings(){\n        return service.createEmbeddings(\n                CreateEmbeddingsRequest\n                        .builder(\"babbage\", \"example input\")\n                        .build());\n    }\n}\n```\n---\n\n#### \u003ca id=\"audio-service\"\u003e\u003c/a\u003e Audio service\n\n[OpenAI Audio Docs](https://platform.openai.com/docs/api-reference/audio)\n\nAudio service is used to turn audio into text, also to make a translations into English. Fell free to play around with builder parameters.\n\u003e ⚠️ As for now, methods that are requiring audio files are blocking. In the nearest future it is planned to add async FilePart implementation.\n\n```java\n@Service\npublic class ExampleService {\n\n    private final AudioService service;\n\n    public ExampleService(AudioService service) {\n        this.service = service;\n    }\n\n    //Blocking\n    public Mono\u003cCreateTranscriptionResponse\u003e createTranscription() {\n        return service.createTranscription(\n                CreateTranscriptionRequest\n                        .builder(\"src/main/resources/exampleAudio.mp3\", \"whisper-1\")\n                        .build());\n    }\n\n    //Blocking\n    public Mono\u003cCreateTranslationResponse\u003e createTranslation(){\n        return service.createTranslation(CreateTranslationRequest\n                .builder(\"src/main/resources/exampleAudio.mp3\", \"whisper-1\")\n                .build());\n    }\n}\n```\n---\n\n#### \u003ca id=\"files-service\"\u003e\u003c/a\u003eFiles service\n\n[OpenAI Files Docs](https://platform.openai.com/docs/api-reference/files)\n\nFile service is used to upload and work with files. Fell free to play around with builder parameters.\n\u003e ⚠️ As for now, methods that are requiring files are blocking. In the nearest future it is planned to add async FilePart implementation.\n\n```java\n@Service\npublic class ExampleService {\n\n    private final FilesService service;\n\n    public ExampleService(FilesService service) {\n        this.service = service;\n    }\n\n    public Mono\u003cListFilesResponse\u003e listFilesResponse() {\n        return service.listFiles();\n    }\n    \n    //Blocking\n    public Mono\u003cUploadFileResponse\u003e uploadFile() {\n        return service.uploadFile(\n                UploadFileRequest\n                        .builder(\"src/main/resources/exampleFile.jsonl\", \"finetune\")\n                        .build());\n    }\n\n    public Mono\u003cDeleteFileResponse\u003e deleteFile() {\n        return service.deleteFile(\"fileId\");\n    }\n\n    public Mono\u003cRetrieveFileResponse\u003e retrieveFile() {\n        return service.retrieveFile(\"fileId\");\n    }\n\n    public Mono\u003cString\u003e retrieveFileContent() {\n        return service.retrieveFileContent(\"fileId\");\n    }\n}\n```\n---\n\n#### \u003ca id=\"fine-tunes-service\"\u003e\u003c/a\u003eFine-tunes service\n\n[OpenAI Fine-tunes Docs](https://platform.openai.com/docs/api-reference/fine-tunes)\n\nFine-tunes service is used to work with fine-tune files and models. Fell free to play around with builder parameters.\n\n```java\n@Service\npublic class ExampleService {\n\n    private final FineTunesService service;\n\n    public ExampleService(FineTunesService service) {\n        this.service = service;\n    }\n\n    public Mono\u003cCreateFineTuneResponse\u003e createFineTune(){\n        return service.createFineTune(\n                CreateFineTuneRequest\n                        .builder(\"trainingFileId\")\n                        .build());\n    }\n\n    public Mono\u003cListFineTunesResponse\u003e listFineTunes(){\n        return service.listFineTunes();\n    }\n\n    public Mono\u003cRetrieveFineTuneResponse\u003e retrieveFineTune(){\n        return service.retrieveFineTunes(\"fineTuneId\");\n    }\n\n    public Mono\u003cCancelFineTuneResponse\u003e cancelFineTune(){\n        return service.cancelFineTune(\"fineTuneId\");\n    }\n\n    public Mono\u003cListFineTuneEventsResponse\u003e listFineTuneEvents(){\n        return service.listFineTuneEvents(\"fineTuneId\");\n    }\n\n    public Mono\u003cDeleteFineTuneModelResponse\u003e deleteFineTuneModel(){\n        return service.deleteFineTuneModel(\"modelId\");\n    }\n}\n```\n---\n\n#### \u003ca id=\"moderations-service\"\u003e\u003c/a\u003eModerations service\n\n[OpenAI Moderations Docs](https://platform.openai.com/docs/api-reference/moderations)\n\nModerations service is used to check for moderation violations. Fell free to play around with builder parameters.\n\n```java\n@Service\npublic class ExampleService {\n\n    private final ModerationsService service;\n\n    public ExampleService(ModerationsService service) {\n        this.service = service;\n    }\n\n    public Mono\u003cCreateModerationResponse\u003e createModeration() {\n        return service.createModeration(\n                CreateModerationRequest.builder(\"violating input\").build());\n    }\n}\n```\n\n## \u003ca id=\"contributings\"\u003e\u003c/a\u003eHow can I help?\n\nThis is the open-source library, any help will be much appreciated. If you can see that there is a way to improve the code or functionality,\nkindly fill out the issue or make a pull request with your changes. Also feel free to look at opened issues and submit a pull request if you have your solution.\n\n## \u003ca id=\"licence\"\u003e\u003c/a\u003eLicense\n\n```text\nMIT License\n\nCopyright (c) 2023 Maksym Volkov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactiveclown%2Fopenai-webflux-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactiveclown%2Fopenai-webflux-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactiveclown%2Fopenai-webflux-java/lists"}