Skip to main content

Quick start

From zero to a stored datapoint in about five minutes.

1. Install

// build.gradle.kts
dependencies {
implementation("ai.intellistream:datahub-sdk:0.1.0")
}

2. Configure credentials

The client reads configuration from the environment (or a .env file): a base URL and either a static token or OAuth2 client-credentials.

BASE_URL=https://api.intellistream.ai
TOKEN=eyJhbGciOi... # or CLIENT_ID / CLIENT_SECRET / TOKEN_URI

3. Create a client and write a datapoint

var client = DatahubClient.fromEnv();

var series = Timeseries.of("engine_temperature").name("Engine temperature");
series.setUnit("celsius");
series.setValueType("float");
client.timeseries().create(series);

client.timeseries().ingest(Map.of(
"engine_temperature", List.of(
Datapoint.of(Instant.now(), 92.4))));

4. Read it back

var filter = new RetrieveFilter();
filter.setExternalId("engine_temperature");
filter.setStart(ZonedDateTime.now().minusHours(1));
filter.setEnd(ZonedDateTime.now());

var request = new DataRetriever<RetrieveFilter>();
request.setItems(List.of(filter));

client.timeseries().retrieve(request).getItems()
.forEach(c -> c.getDatapoints().forEach(System.out::println));
Pick once, follow everywhere

The tabs above all switch together — and your choice persists as you move through the docs. One selection for the whole site.

Next: a real program

The tutorial turns these calls into a complete agent: it samples your machine's memory every few seconds, creates its series idempotently, and survives API outages with the durable ingest buffer.