Skip to main content

Sending time series

InertialAI models read numbers through a dedicated numeric vocabulary rather than as ordinary digits. A 240-point series becomes 256 tokens instead of roughly 976, and values that are close in magnitude are close in the model's representation — which is what lets it reason about level, spread and shape instead of about text that happens to contain digits.

You do not have to do any of that yourself. Put the raw numbers in series and the API handles the encoding.

from openai import OpenAI

client = OpenAI(base_url="https://inertialai.com/api/v1", api_key="YOUR_KEY")

response = client.chat.completions.create(
model="inertialai-0.1",
messages=[{"role": "user", "content": "Is there an anomaly? Where, and what kind?"}],
extra_body={
"series": [120.4, 119.8, 121.2, 120.9, 155.3, 121.0, 120.6],
"rate": "5m",
},
)
print(response.choices[0].message.content)

The encoded series is prepended to your last user message, so the question reads naturally against the data.

Fields

FieldTypeNotes
seriesnumber[] or number[][]One channel, or several for cross-channel questions. Minimum 8 points per channel.
ratestringSpacing between samples — 1h, 5m, 1d. Labels the series; defaults to 1h.

Multiple channels are labelled A, B, C… in the order given, so you can ask which one leads the other:

{
"model": "inertialai-0.1",
"series": [[101.2, 103.4, "..."], [55.1, 55.9, "..."]],
"messages": [{"role": "user", "content": "Does channel A lead channel B?"}]
}

Units

State the units in your question. The model converts from its internal representation back into your units, and telling it what they are is what makes that conversion meaningful:

This is outlet temperature in °C. What is the value at index 74?

Without units the answer is still correct in magnitude, but it cannot label it for you.

What comes back

The response is the standard OpenAI shape, plus an inertial_encoding block describing what the API did with your numbers:

{
"choices": [{ "message": { "role": "assistant", "content": "..." } }],
"inertial_encoding": {
"channels": [{ "n": 240, "scale": 0.0179, "offset": 88.845, "tokens": 156 }]
}
}

n is the number of points received and tokens is what they cost, so you can size a request before sending it.

Limits and rejections

The API rejects rather than guesses:

  • fewer than 8 points in a channel — too short to have structure
  • NaN or infinity anywhere in the series
  • a constant series — there is nothing to analyse, and answering would mean inventing it

Long series are handled, but resolution is what matters, not length: 240 points that capture two full cycles beat 5,000 points of the same shape.

Already encoded?

If your message already contains an encoded series, omit series and send the message as normal. The two paths do not interfere.