Zero-dependency Java 17+ and Kotlin client for the Nodecode API, built for Cyber v1 (nodecode-cyber-v1), Decide v1 (nodecode-decide-v1), and Image v1 (nodecode-image-v1).
Operated by Foresight Labs (EU entity) with zero data retention.
Uses java.net.http.HttpClient and an internal RFC 8259 JSON codec only - no OkHttp, Jackson, Gson, or Kotlin stdlib transitive conflicts. Drops cleanly into Spring Boot services, Gradle/Maven projects, Burp Suite Montoya extensions, and OWASP ZAP add-ons.
Published on Maven Central as ai.nodecode:nodecode-java:0.1.0.
<dependency>
<groupId>ai.nodecode</groupId>
<artifactId>nodecode-java</artifactId>
<version>0.1.0</version>
</dependency>dependencies {
implementation("ai.nodecode:nodecode-java:0.1.0")
}Requires Java 17+.
Create an API key (sk-nc-...) at nodecode.ai/account/keys and set NODECODE_API_KEY:
import ai.nodecode.*;
public class Quickstart {
public static void main(String[] args) {
NodecodeClient client = NodecodeClient.create(); // reads NODECODE_API_KEY
ChatCompletionResponse resp = client.chatCompletion(
ChatCompletionRequest.builder()
.model(NodecodeModels.CYBER_V1)
.addUserMessage("22/tcp and 8080/tcp are open. What next, in order?")
.maxTokens(600)
.build()
);
System.out.println("Reasoning: " + resp.firstReasoning());
System.out.println("Answer: " + resp.firstContent());
}
}ChatCompletionRequest req = ChatCompletionRequest.builder()
.model(NodecodeModels.CYBER_V1)
.addUserMessage("Audit this Dockerfile for privilege escalation.")
.maxTokens(1024)
.build();
try (ChatCompletionStream stream = client.chatCompletionStream(req)) {
for (ChatCompletionChunk chunk : stream) {
if (!chunk.choices().isEmpty()) {
String delta = chunk.choices().get(0).delta().content();
if (delta != null) {
System.out.print(delta);
}
}
}
}Cyber v1 thinks first, and maxTokens covers both thinking and final output. Passing a very small maxTokens (such as 100) can exhaust the budget during reasoning and return empty content with finishReason "length". Give calls at least a few hundred tokens.
client.listModels()/client.getModel(NodecodeModels.CYBER_V1)- live model list and pricing (works without an API key, costs nothing).client.usage()- remaining balance, plan allowance, and running concurrency slots (GET /v1/usage, costs nothing).client.generateImage(req)- Image v1 (nodecode-image-v1) viaPOST /v1/images/generationswithdecodeBytes()forb64_json.NodecodeException- unchecked API error withisInsufficientBalance(),isRateLimited(),isUnauthorized(), and parsedrefill()metadata on HTTP 402.
- Maven Central (
ai.nodecode:nodecode-java) - Nodecode
- Cyber v1
- Cyber v1 API quickstart
- Models and providers
- Pricing
MIT. Copyright (c) 2026 Foresight Labs.