{"id":19711802,"url":"https://github.com/dexuby/openai4j","last_synced_at":"2026-05-03T05:31:49.801Z","repository":{"id":206220257,"uuid":"716120297","full_name":"dexuby/openai4j","owner":"dexuby","description":"OpenAI API Client in Java","archived":false,"fork":false,"pushed_at":"2023-11-19T19:45:37.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T14:29:41.142Z","etag":null,"topics":["api-client","assistants","client","gpt4","java","openai","openai-api"],"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/dexuby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-08T13:38:29.000Z","updated_at":"2023-11-14T21:11:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"7f1abc07-16c8-4ab2-b6fc-939ea2344189","html_url":"https://github.com/dexuby/openai4j","commit_stats":null,"previous_names":["dexuby/openai4j"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexuby%2Fopenai4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexuby%2Fopenai4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexuby%2Fopenai4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dexuby%2Fopenai4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dexuby","download_url":"https://codeload.github.com/dexuby/openai4j/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241029944,"owners_count":19896996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-client","assistants","client","gpt4","java","openai","openai-api"],"created_at":"2024-11-11T22:14:13.469Z","updated_at":"2026-05-03T05:31:44.766Z","avatar_url":"https://github.com/dexuby.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://jitpack.io/v/dexuby/openai4j.svg)](https://jitpack.io/#dexuby/openai4j)\n# openai4j\nEasy to use OpenAI API Client in Java.\n\nRequirements:\n- Java 17+\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.dexuby\u003c/groupId\u003e\n    \u003cartifactId\u003eopenai4j\u003c/artifactId\u003e\n    \u003cversion\u003e...\u003c/version\u003e\n\u003c/dependency\u003e\n```\nLatest version can be found here: https://github.com/dexuby/openai4j/releases\n\nHas been made in a really short amount of time so currently pretty much only supports all the new Beta features like Assistants (and TTS). Method and Class names usually match the API Documentation names.\n\nSupported API features:\n- Audio\n  - Create speech\n- Assistants\n  - Full support\n- Threads\n  - Full support\n- Messages\n  - Full support\n- Runs\n  - Full support\n- Images\n  - Create\n    \nExample usage:\n```java\nfinal OpenAIClient client = new OpenAIClient(\"\u003cYOUR API KEY\u003e\");\nfinal Assistant assistant = client.createAssistant(\n    AssistantCreationRequest.builder()\n        .model(Model.GPT_4_TURBO)\n        .name(\"Example\")\n        .description(\"Just an example assistant.\")\n        .instructions(\"You are a helpful assistant.\")\n        .build()\n    ).join();\nfinal Thread thread = client.createThread(ThreadCreationRequest.empty()).join();\nclient.createMessage(thread.id(),\n    MessageCreationRequest.builder()\n        .role(Role.USER)\n        .content(\"Hey, can you tell me what time it is in New York?\")\n        .build()\n    ).join();\nfinal Run run = client.createRun(thread.id(),\n    RunCreationRequest.builder()\n        .assistantId(assistant.id())\n        .build()\n    ).join();\n```\n\nTo-do - If you want to contribute you can work on those items:\n- Improve/clean up request handling.\n- Support for non-Beta API features.\n- Support for rate limit headers.\n- Better error handling.\n- ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdexuby%2Fopenai4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdexuby%2Fopenai4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdexuby%2Fopenai4j/lists"}