Feature request: Official Java SDK for Codex
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What variant of Codex are you using?
CLI
What feature would you like to see?
Feature request: Official Java SDK for Codex
Summary
It would be very useful to have an official Java SDK for Codex, similar to the existing SDK support available in other languages.
We are integrating Codex into a Java-based agentic software engineering platform, and today the available integration options require either:
- spawning and managing
codex app-serveras an external process and implementing the JSON-RPC protocol manually; - introducing a separate Python service only to access the Codex SDK;
- or relying on lower-level/internal integration approaches.
An official Java SDK would significantly simplify this kind of integration.
Use case
Our application is primarily Java-based and implements a multi-agent software engineering workflow.
We would like to use Codex programmatically for capabilities such as:
- ChatGPT account authentication;
- starting and resuming threads;
- starting turns;
- streaming model responses and events;
- configuring model, working directory, sandbox and approval policies;
- handling tool calls and approvals;
- retrieving account and model information;
- managing conversation/session lifecycle.
Ideally, the Java API could expose abstractions similar to:
try (CodexClient codex = CodexClient.builder()
.workingDirectory(projectPath)
.build()) {
codex.loginWithChatGPT();
CodexThread thread = codex.startThread();
CodexTurn turn = thread.startTurn(
"Analyze this project and identify the main architectural components."
);
turn.onTextDelta(System.out::print);
turn.awaitCompletion();
}
Why a Java SDK would be valuable
Java is still widely used for enterprise applications, developer tools, IDE integrations, backend platforms and large software modernization projects.
Without an official Java SDK, Java applications currently need to reproduce a substantial amount of infrastructure around codex app-server, including:
- process lifecycle management;
- JSON-RPC request/response correlation;
- event streaming;
- authentication flows;
- reconnection and error handling;
- protocol evolution and compatibility.
A supported SDK would also insulate applications from changes in the underlying App Server protocol.
Suggested scope
Even an initial lightweight SDK covering the main App Server APIs would already be extremely useful:
initializeaccount/login/startaccount/readthread/startthread/resumethread/forkturn/startturn/interrupt- event / notification streaming
- models listing
- approval handling
It could internally use codex app-server, so the Java SDK would not necessarily need to reimplement the Codex runtime itself.
Alternative
If a full Java SDK is not currently planned, an officially supported Java client library for the Codex App Server protocol would already solve most of the integration problem.
Thanks for considering it.
Additional information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Codex app-server JSON-RPC surface and the listed APIs, including authentication, threads, turns, event streaming, models, and approvals. Done would mean an officially supported Java SDK or client library covering the proposed integration scope and insulating callers from protocol changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100